I am trying to write a bundle to manage common functions across multiple App development in Symfony 4.
I have created a new blank App and new Blank bundles to which I have gradually been adding functionality. To get both annotation routing and twig template paths I have had to add details to of the paths to the App config to get the bundle to work. This seems strange to me as I had hoped that the bundle configuration would be self contained, placing appropriate hooks for the App to grab and use.
I have added a route file in the App at config/route/hillrange_admin.yaml
hillrange_admin:
resource: '@HillrangeAdminBundle/Controller/'
type: annotation
prefix: /hillrange/admin/
The other file I have alters in the App is for the twig template paths, in config/packages/twig.yaml
twig:
default_path: '%kernel.project_dir%/templates'
paths:
'%kernel.project_dir%/templates/bundles/HillrangeAdmin': hillrange_admin
'%kernel.project_dir%/vendor/hillrange/admin/Resources/views': hillrange_admin
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
This was the only way I could get the overrode of templates as discussed at https://symfony.com/doc/current/templating/overriding.html. This article does not mention any settings required to make the system work correctly.
So my question: What am I missing that I need to add configuration to the App to make the bundle work. I have read a lot of documentation, but as yet I have not found the information that makes it all work as I expect to work?
The bundle structure follows https://symfony.com/doc/current/bundles/best_practices.html and the App follows the structure mentioned at https://symfony.com/doc/current/best_practices/creating-the-project.html
Thanks for any thoughts.
Craig