Using Silex, how can I get the current Route object from inside a before filter? e.g.,
before
$app->before(function() use ($app) { // need to access Route for matched URL here });
I need the whole object, not just the name.
Not tested, but this should work.
$app->before(function(Request $req, Application $app) { $route = $app['routes']->get($req->get('_route')); });
Just curious, why you need the Route object?