contao/contao-bundle — pull request #8 by aschempp (2014-09-08 07:11:44+00:00)
Title: [WIP] Dynamic routing using CmfRoutingBundle

Here's a frist very rough draft of using the CmfRoutingBundle. Using CmfRouting has several advantages:

1. It provides a dynamic routing component, which can look up routes in a database. This will allow Symfony to know about the routes (reverse lookups)
2. It also provides route chaining. The ChainRouter can walk through several Routers and try to find a match. This means we can have static routes for the Contao backend and dynamic routes for the frontend. Also, third party developers can add their own Router to the chain if necessary.

I have used the features of the dynamic router to handle routes by "type" (so called content document). Currently, there are types for each Contao page type, e.g. `pageRegular`. However, it could possibly also provide routing for any other type like Avisota's newsletter view, without requiring a page in the page tree.

The special `LegacyController` can handle Contao 2/3 `TL_PTY` for backwards compatibility. For this reason, we must not change/remove the `PageRegular` class, because extensions might extend it. However, this should certainly be deprecated.

I have currently implemented a `RegularPageController` that basically does nothing. All of it's functionality should be re-thought in my opinion. As an example, a lot of the functionality in `PageRegular` is layout-related, that's the reason the `PageError403` actually renders a `PageRegular` internally.

### Tasks
- [ ] Re-implement maintenance mode (see https://github.com/contao/contao-bundle/pull/5 and https://github.com/contao/contao-bundle/pull/1)
- [ ] Re-implement user authentication and authorization (maybe using security service?)
- [ ] Add a layout service/factory to get layout details based on page model
- [ ] Add `HttpException` handler to render 404s using the Contao 404 page
- [ ] Add `HttpException` handler to render 403s using the Contao 403 page
- [ ] Check/make sure routes with domain information precede routes without domain
- [ ] Add support for dumping routes in the console (if necessary)

### Questions
- There are hooks in the page type, which probably can't be supported anymore?
- Can we remove support for root pages without domain?
- How do we handle deprecated stuff? I suggest adding `E_USER_DEPRECATED` warnings which can be disabled in production environments.

### Other

Requires https://github.com/contao/contao/pull/24