I'm developing a bundle with frontend and backend. I follow instructions about the best way to structure controllers and views for backend and frontend parts here and here. But I can't find how to specify subdirectories in my routing configuration file. I try to put this, but it does not work.
post:
pattern: /
defaults: { _controller: "HavactBlogBundle:Backend/Post:Backend/index" }
try this: replace the slash with the backslash
post:
pattern: /
defaults: { _controller: "HavactBlogBundle:Backend\Post:index" }
For those people not wanting to expose their controllers as a service (which is an indirect solution to the problem), you specify the route as such.
route_name:
path: /path
defaults: { _controller: BundleName:Namespace/Controller:action }
Namespace
is your subdirectory in the bundle's Controller
directory followed by /
to separate it.
All else should work just the same.
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