Comparing route to current request in Symfony
问题 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? 回答1: Or, more generally, is there an idiomatic way of setting the active page when creating site navigation in Symfony? Don't use sfContext::getInstance(),