Skip to content
Advertisement

Symfony2 generate controller inside custom folder

Symfony2 has a command for generating controllers

http://symfony.com/doc/current/bundles/SensioGeneratorBundle/commands/generate_controller.html

Command’s default behavior is to generate the given controller inside controller folder within the bundle.

Is it possible to customize the folder where the controller will be generated ( controller/backend for example ) ?

Advertisement

Answer

You can get all the available options of this command with the help command:

JavaScript

No you can’t with the current task, but you could extend the GenerateControllerCommand to add custom options. Check out its generate function:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement