symfony/symfony — pull request #3378 by arnaud-lb (2012-02-16 14:11:00+00:00)
Title: [Routing][WIP] hostname pattern for routes

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: not yet

This adds a hostname_pattern property to routes. It works like the pattern property (hostname_pattern can have variables, requirements, etc). The hostname_pattern property can be set on both routes and route collections.

This is a work in progress.

What has been done:

- Yaml and annotation loaders support
- PhpDumper (UrlMatcher and UrlGenerator)

What is left to be done:

- Support for other loaders and dumpers

Yaml example:

```
AcmeBundle:
resource: "@AcmeBundle/Controller/"
type: annotation
prefix: /
hostname_pattern: {locale}.example.com
requirements:
locale: en|fr

some_route:
pattern: /hello/{name}
hostname_pattern: {locale}.example.com
requirements:
locale: en|fr
name: \w+
defaults:
_controller: Foo:bar:baz
```