Boilerplate for creating a new console project using
symfony/console
.
composer create-project simpl/console [your-project-name] --stability=dev
php console help app:hello
php console app:hello
name
parameterphp console app:hello --name="Josh"
You can add new commands by adding a class that extends Symfony\Component\Console\Command\Command
to the app\Commands
directory.
Once you’ve added your command, register it in the console
script.
// ... register commands
$application->add(new Commands\Hello());
See
app\Commands\Hello
for an example.