Closed
Description
Hi there
Having a route defined like this
class MyController extends Controller
{
/**
* @Route(
* "/mycontroller/{type}",
* name="my_route",
* condition="service('myservice').isKnownType(request.get('type'))"
* )
*/
public function testAction($type)
{
//do something here
}
}
Makes the router:match to go crazy because the Request object is unknown to the command line
app/console router:matches /mycontroller/supertype
[RuntimeException]
Unable to get a property on a non-object.
I believe that a request object should be created here. This is also a very simple example that could have a workaround, but this is not a discussion about that.
Note: the service function used in the expression language is an implementation of a custom expression language function, which is just returning a defined service