I would like to isolate some controllers in a subdirectory in my Symfony2 app. Something like that:
route:
resource: "@MyBundle/Controller/Admin/"
type: annotation
prefix: /admin/
In this directory there is 6 controller class. I can import these separatly but it's not practical ...
Thanks for your help.
I use this which includes every controller in that folder:
core:
resource: "@AppCoreBundle/Controller"
type: annotation
The same code applies to subfolders:
core_admin:
resource: "@AppCoreBundle/Controller/Admin"
type: annotation
It's perfectly okay to create subfolders inside the Controller folder to split your public and admin controllers.
Of course you could include each of them one by one instead, but that's extremely tedious.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With