Symfony2 KnpMenuBundle: set active a menu item even when its not on that menu
问题 I created my menu builder and it works. One of my route is /database But this has a child route: database/view/{id} I don't want to put the view route into the menu items because without the ID it won't work. But I want the database route to be active when the user is on the view. How can I do this? 回答1: Managed to solve it with this little hack: in the menuBuider after you add all the Children but before you return the menu i added $request = $this->container->get('request'); $routeName =