I'm having quite a few bundles whose routing rules I don't want to include by hand in my main routing.yml, so I'm looking for a way to define a route that is then forwarded to a controller depending on the parameters in the url.
Something like this in my routing.yml:
foo_main:
path: /foo/{bundle}/{action}
defaults: { _controller: "Foo{bundle}Bundle:Api:{action}" }
It should behave like this:
/foo/acme/index
-> FooAcmeBundle:Api:indexAction
/foo/bar/show
-> FooBarBundle:Api:showAction
...
I already saw there is a custom route provider that could automatically register new routes, if the above is not possible. But I guess I have to add a custom route provider to each bundle, which seems like a unnecessary overhead if each bundle registers its route the same way.
PS: I'm using Symfony 2.3.1 right now.