symfony-cmf/RoutingBundle — pull request #156 by EmmanuelVella (2013-08-21 11:26:07+00:00)
Title: [WIP] Add hosts

Hi !

Related to #33, I'm trying to find a solution to organize routes tree per hostname. The following code works, but I'm not sure that the good way to achieve this.

I created a new ``Host`` document which extends ``Route``, this way it can behave like a ``Route``, and is easy to identify. But I don't like having an empty objet, maybe you'll have a better idea.

- In the IdPrefixListener, I try to find a ``Host`` object and if one is found, I append it to the idPrefix
``/cms/routes`` will become ``/cms/routes/``

- Then in the ``RouteProvider``, I keep the previous url candidates and I add new ones prefixed by the current request host :
```
/cms/routes/test.html
/cms/routes/test
/cms/routes
```
and
```
/cms/routes//test.html
/cms/routes//test
/cms/routes/
```

Feedback would be appreciated ! Thanks.