We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42838
    • 28 Posts
    I want to introduce to your attention a small helper for creating a modx elements using the console.

    This is a small php-helper for creating chunks, templates and snippets from the console. Those who worked with artisan will appreciate this little helper.

    With a simple console command, you can quickly create the element you need, a file for it, and link this file to a record in the database. If you already have an item in the database - you can also quickly move it to the FS using this small utility.

    Put helper file in your project folder and call it from console.

    php modxhelper.php
    


    helper works in the input wait mode, follow the tips to work.

    You can see available commands if send 'help' command or empty input.

    Fast input
    You can send all options for command after command name

    Example create elements
    D:\www\projectfolder>php modxhelper.php
    
    Hi, i'm ModHelper. Input command
    --> chunk test
    Chunk created
    


    Example create new template
    D:\www\projectfolder>php modxhelper.php
    
    Hi, i'm ModHelper. Input command
    --> template ? test TestName
    Template created
    


    https://github.com/vasenin26/modxHelper