Issue 1:
It would be useful if the route generator could filter by certain route criteria, especially "host".

(Sorry, I already posted in #6088 but that issue is already closed, and the request was for a different use case.)

Here is a possible use case for a generator that filters by host, please feel free to point out an alternative approach though. In short, I want to be able to do something like this in Twig:

{{ path('contact') }}

and get the right route depending on the current hostname (but other applications might have other criteria).

Let's say I have English and German versions of a site, under different domains: example.co.uk and example.de. Then, I can import groups of routes like this:

uk_routes:
resource: @MyBundle/Resources/config/routing_uk.yml
host: "example.co.uk"

de_routes:
resource: @MyBundle/Resources/config/routing_de.yml
host: "example.de"

Then, in each file, I might try something like this:

# routing_uk.yml
contact:
path: /contact
defaults:
_controller: my_site.controller.default:contactAction

# routing_de.yml
contact:
path: /kontakt
defaults:
_controller: my_site.controller.default:contactAction

But... this won't work, because one "contact" route silently overwrite the other.

An "alias" (or "forward") parameter would help here:

# routing_uk.yml
uk_contact:
alias: contact
path: /contact
defaults:
_controller: my_site.controller.default:contactAction
options:
foo: bar_uk_example

# routing_de.yml
de_contact:
alias: contact
path: /uber_uns
defaults:
_controller: my_site.controller.default:contactAction
options:
foo: bar_de_example

If only one route had the "contact" alias, it's easy for the Generator to know which route to use (we could even just duplicate the route behind the scenes, to save a copy and paste).

But here, the routing generator is faced with two different routes with the same alias. So it needs to decide which one to pick. In this case, I want it to filter on the host (each route has this, but I defined it at the file level instead of each route). Maybe there are other things to filter on too, so it should be configurable/extensible.

For now, I have created a very basic route generator that does this. It's part of a very rough/experimental bundle that should probably be split apart, but hopefully it gives an idea.

Of course, I could be looking at this the wrong way. Maybe we don't need route aliases, but namespaces? Or multiple routers (but then, how to select which one is being used?)

I also started a mailing list topic about this. I'm interested to know the best approach, how other people satisfy this use case, and whether a future Symfony route generator can allow allow multiple route candidates (aliases, or similar).

Issue 2:
When Symfony2 was launched in the summer of 2011, Twig was a relatively new project and thus, Symfony decided to support both Twig and PHP templates. Now it's clear that Twig is the way to go when developing Symfony applications and it's getting better and better with each new version.

That's why I'd like to propose to drop PHP templates support entirely for Symfony 3.0.

Pros:

Much less code to maintain, specially on heavy components such as forms.

Much less documentation to write or maintain. We could use those resources to create new docs or improve the existing ones.

Ideally, if we only define one default templating format, we could also optimize Symfony performance and configuration .

Cons:

The tiny fraction of developers still using PHP templates will have to configure something or install something to be able to use PHP templates.