Generating a New Command
Generating a New Command¶
If your application is based on Symfony 2.x version, replace
php app/console before executing any of the console commands included
in this article.
generate:command command generates a new Command class for the given
By default the command is run in the interactive mode and asks questions to determine the bundle and the command name:
$ php bin/console generate:command
The command can be run in a non interactive mode by using the
--no-interaction and providing the needed arguments:
$ php bin/console generate:command --no-interaction AcmeBlogBundle blog:publish-posts
bundle: The name of the bundle where the command class is generated.
name: The name of the command as you type it in the console.
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.