-
Symfony version(s) affected6.3.0 DescriptionPrior to Symfony 6, it was possible to import all controllers from a bundle using the following configuration:
The bundle itself inherited from In Symfony 6, it is recommended to inherit from When I simply change Symfony\Component\HttpKernel\Bundle\Bundle to Symfony\Component\HttpKernel\Bundle\AbstractBundle, an error occurs:
If I revert the inheritance back to How to use importing all routes from all controllers in a bundle folder Symfony 6+ with a new api AbstractBundle ? How to reproducesimply change Symfony\Component\HttpKernel\Bundle\Bundle to Symfony\Component\HttpKernel\Bundle\AbstractBundle Possible SolutionNo response Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
AbstractBundle assumes the modern bundle structure by default (when you don't override |
Beta Was this translation helpful? Give feedback.
-
Yes, it works. Unfortunately it wasn't obvious to me |
Beta Was this translation helpful? Give feedback.
-
What confused me is that with the new structure and compatible API(Symfony\Component\HttpKernel\Bundle\Bundle) this link works |
Beta Was this translation helpful? Give feedback.
AbstractBundle assumes the modern bundle structure by default (when you don't override
getPath()
), so it would look like@AcmeBundle/src/Controller/
for such bundles.And if your bundle does not follow the modern structure, you need to override the
getPath
method to make it return the right path