I have an application written with Symfony and want to merge some small bundles as part of that app.
Regarding the quick Symfony2 bundle tour from Sonata, I need an ApplicationBundle.
quick Symfony2 bundle tour:
- There are two types of bundles:
- Application Bundle (AB),
- Vendor Bundle (VB), that should not be modified inside a project.
- The AB directory is where developers implement the project requirements,
- An AB can overwrite almost everything from a VB, example: you can redefine a VB template at the AB level.
(Source)
Symfony documentation says about architecture:
The directory structure of a Symfony application is rather flexible, but the recommended structure is as follows:
- app/: the application configuration;
- src/: the project's PHP code;
- vendor/: the third-party dependencies;
- web/: the web root directory
(Source)
But where shall I place it?
There are two possibilities:
But what is the right one?
And why are there two possibilities?
The Symfony documentation doesn't cover ApplicationBundle.
Thanks for any hints.
The documentation say that :
src/
directory.vendor/
directory (and came from your composer.json
dependencies).You can (and should) create many bundles for you application.