symfony/symfony — pull request #12960 by nikita2206 (2014-12-12 15:36:56+00:00)
Title: Add conditions to resolveParameters of FrameworkBundle/Router

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -

Adds ability to use parameters in route conditions like you can use them in container definitions:

```php
contact:
path: /contact
defaults: { _controller: AcmeDemoBundle:Main:contact }
condition: "context.getMethod() in ['GET', 'HEAD'] and request.headers.get('User-Agent') matches '%allowed_user_agents%'"
```

As you could see replacement of the placeholder happens before ExpressionLanguage will tokenize and compile the expression so it looks kinda ad-hoc and primitive.

This PR is a different implementation of #12869 which is I think is too overcomplicated for this feature.