Comparing route to current request in Symfony

Posted by gruner on Stack Overflow See other posts from Stack Overflow or by gruner
Published on 2010-04-29T18:47:44Z Indexed on 2010/04/29 22:17 UTC
Read the original article Hit count: 214

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about symfony

Related posts about routing