Comparing route to current request in Symfony
- by gruner
For my site navigation I'd like to indicate the current page. If each page in the navigation has its own route is there a way to see if the current request matches the route? Something like:
$request->getRoute() == '@my_route'
Or, more generally, is there an idiomatic way of setting the active page when creating site navigation in Symfony?