Everything is a bundle
In the previous chapter, we dug in to the basic Symfony2 directory structure. Within the src
directory, we already had two bundles: one called DemoBundle
within the Acme
subdirectory and the other one within AppBundle
.
DemoBundle
is a showcase of an example bundle that has existed since the beginning of Symfony2. It has been created to demonstrate how Symfony2 organizes things. AppBundle
is a relatively new thing, introduced in Symfony 2.6 with a new concept of work.
Until the 2.6 version, it was recommended to contain a bundle within the vendor namespace. With Symfony 2.6 and its new best practices rules, it is now recommended to keep the custom application code within the handy AppBundle
and create other bundles only if you want to create reusable code to be shared among your other projects.
Bundles don't have a fixed directory structure. In fact, you can have a bundle without most of the directories. If you create a utility bundle, it will probably have only...