Creative Commons License
This work is licensed under a
Creative Commons
Attribution-Share Alike 3.0
Unported License.

Master Symfony2 fundamentals

Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).
trainings.sensiolabs.com

Discover the SensioLabs Support

Access to the SensioLabs Competency Center for an exclusive and tailor-made support on Symfony
sensiolabs.com
Caution: You are browsing the documentation for Symfony version 2.1 which is not maintained anymore. If some of your projects are still using this version, consider upgrading.

SensioGeneratorBundle

The SensioGeneratorBundle extends the default Symfony2 command line interface by providing new interactive and intuitive commands for generating code skeletons like bundles, form classes or CRUD controllers based on a Doctrine 2 schema.

Installation

Download the bundle and put it under the Sensio\\Bundle\\ namespace. Then, like for any other bundle, include it in your Kernel class:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
public function registerBundles()
{
    $bundles = array(
        ...

        new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(),
    );

    ...
}

List of Available Commands

The SensioGeneratorBundle comes with four new commands that can be run in interactive mode or not. The interactive mode asks you some questions to configure the command parameters to generate the definitive code. The list of new commands are listed below: