Does the RoutingBundle even work for Symfony3? I tried to install it and got some weird errors:
$ php composer.phar require symfony-cmf/routing-bundle
Using version ^1.4 for symfony-cmf/routing-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
And then this whole bit came right after:
Problem 1 - Installation request for symfony-cmf/routing-bundle ^1.4 -> satisfiable by symfony-cmf/routing-bundle[1.4.0]. - Conclusion: remove symfony/symfony v3.0.4 - Conclusion: don't install symfony/symfony v3.0.4 - symfony-cmf/routing-bundle 1.4.0 requires symfony/framework-bundle ~2.3 -> satisfiable by symfony/framework-bundle[v2.3.0, v2.3.1, v2.3.10, v2.3.11, v2.3.12, v2.3.13, v2.3.14, v2.3.15, v2.3.16, v2.3.17, v2.3.18, v2.3.19, v2.3.2, v2.3.20, v2.3.21,...
- don't install symfony/framework-bundle v2.8.3|don't install symfony/symfony v3.0.4
- don't install symfony/framework-bundle v2.8.4|don't install symfony/symfony v3.0.4
- Installation request for symfony/symfony (locked at v3.0.4, required as 3.0.*) -> satisfiable by symfony/symfony[v3.0.4].
Installation failed, reverting ./composer.json to its original content.
What I need is to have a dynamic router such that most requests (unless they match a different specific route) will go through one bundle/controller/action.
I tried just changing the routing.yml for my bundle like this:
mybundle_homepage:
path: /{page}
defaults: { _controller: MybundleBundle:Default:index }
requirements:
path: ".+"
So that any route domain.dev/page/another-page/yet-another-sub-page... would go to this controller. (Hope that makes sense)
And that didn't work either. What am I missing?
ChainRouter
andDynamicRouter
classes is. Maybe you can integrate them directly in your application as a workaround. – xabbuh