How you can create a new bundle in Symfony 2.6

Hi guys, today I want to speak about Symfony's bundles. In this tutorial I will explain to you how you can create your first bundle in Symfony 2.6. A symfony bundle is a group of files and folders, php classes, assets, etc. You can create a bundle for all your Symfony application.

A new bundle can be created either manually, or automatically using dos.

To create a bundle automatically, follow these steps:

  • Download composer.phar and copy it into your Symfony project.
  • Press Shift and right click to open a command prompt into your Symfony project.
  • Enter: php app/console generate:bundle
  • Bundle namespace: TestBundle
  • Keep TestBundle as the bundle namespace (choose no to try again)? [yes]: Enter
  • Bundle name [TestBundle]: TestTestBundle
  • Target directory [G:/xampp/htdocs/symfony2.6/src]: Enter
  • Configuration format (yml, xml, php, or annotation): yml
  • Do you want to generate the whole directory structure [no]? yes
  • Do you confirm generation [yes]? Enter
  • Confirm automatic update of your Kernel [yes]? yes
  • Confirm automatic update of the Routing [yes]? yes
  • You can now start using the generated code!

Video Tutorial:

 









Leave a Comment