The short version: What objects do I, the end user programmer, have access to when using Symfony's routing conditions?
The long version: Symfony routes allow you to use a key named condition
.
contact:
path: /contact
controller: 'App\Controller\DefaultController::contact'
condition: "context.getMethod() in ['GET', 'HEAD'] and request.headers.get('User-Agent') matches '/firefox/i'"
The value of condition
is code -- it's a Symfony Domain Specific Language (DSL) based on (but not identical to?) the twig templating language syntax. The Symfony docs refer to this as "The Expression Syntax".
That much I've been able to glean from the documentation. What I can't figure out is what object I'll have access to using this DSL? i.e. in the example above the expression seems to have access to a context
object and a request
object.
Are there others? Are there docs or a place in the source code where I can see what other objects I'd have access to with condition
?