In my symfony project I have a bundle named Modules that included of many modules that each one saved in a separate directory into src/ModuleBundle/Modules directory and they have separate twig files as their templates.
file structure for an sample module named RandomImage
src
ModuleBundle
Modules
RandomImage
Resources
views
public
I don't have any problem with loading twig files for each module but my problem is about assetic:dump function that can't find my modules assetic.
Symfony move into all twig files and fetch all assetic files that listed inside {% stylesheets %} and {% javascripts %} block or used in {{ asset() }} function.
In my research i understand that Symfony search and map assetic in two target
- assetics listed in base template twig file (e.g. app/Resources/views/base.html.twig)
- assetics listed in each one of bundles twig files (e.g. src/myBundle/Resources/views/index.html.twig)
How I can add new target for Symfony to fetch assetic files from their twig files?
src > Modules > RandomImageBundle
), bundle is a synonym of module so your architecture looks really redundant. – Alain Tiemblo