Expression Language in conditional routing - service in context
According to docs , there are only two things available by default, while using expression language in conditional routes - context and request . I would like to use foo service with boolean bar() method to determine condition. How to inject foo service into this condition? So far I've tried: some_route: path: /xyz defaults: {_controller: "SomeController"} condition: "service('foo').bar()" and some_route: path: /xyz defaults: {_controller: "SomeController"} condition: "service('foo').bar() === true" but all I get is: The function "service" does not exist around position 1. P.s.: I'm using