Description
It seems that the directory structure for bundles is not very clearly defined and has contradicting info in the Documentation.
- https://symfony.com/doc/current/bundles.html#bundle-directory-structure
- https://symfony.com/doc/current/bundles/best_practices.html#directory-structure
- https://symfony.com/doc/current/templates.html#bundle-templates
I noticed this, because I tried to find out where bundle templates are supposed to go. The first link says:
templates/
Holds templates organized by controller name (e.g. category/show.html.twig).
The second link says (in the table a little further down):
Templates |
templates/
But the third link says:
If you install packages/bundles in your application, they may include their own Twig templates (in the Resources/views/ directory of each bundle). To avoid messing with your own templates, Symfony adds bundle templates under an automatic namespace created after the bundle name.
And the later one seems to be correct. I know that the structure is a convention, but I think that this is very confusing at the moment. E.g.: Will a twig namespace not be created for a templates folder?