Generar un Bundle (Symfony 2 contempla todo en conceptos de bundle y no de aplicaciones como en symfony 1.4)¶
php app/console generate:bundle --namespace=JobeetBundle
Bundle name [JobeetBundle]: The bundle can be generated anywhere. The suggested default directory uses the standard conventions. Target directory [/var/www/html/symfony27/src]: Determine the format to use for the generated configuration. Configuration format (yml, xml, php, or annotation): yml To help you get started faster, the command can generate some code snippets for you. Do you want to generate the whole directory structure [no]? yes Summary before generation You are going to generate a "JobeetBundle\IbwJobeetBundle" bundle in "/var/www/html/symfony27/src/" using the "yml" format. Do you confirm generation [yes]? yes Bundle generation Generating the bundle code: OK Checking that the bundle is autoloaded: OK Confirm automatic update of your Kernel [yes]? yes Enabling the bundle inside the Kernel: OK Confirm automatic update of the Routing [yes]? yes Importing the bundle routing resource: OK You can now start using the generated code!
Borrar Cache
php app/console cache:clear --env=prod
php app/console cache:clear --env=dev
Editar parametros del sistema
app/config/parameters.yml
Agregar nuestro Bundle al AppKernel.php
app/AppKernel.php
$bundles = array( ........... new JobeetBundle\IbwJobeetBundle(), );
Agregar rutas
app/config/routing_dev.yml
Algo parecido a:
jobeet: resource: "@JobeetBundle/Resources/config/routing.yml" prefix: /