I have a question regarding the rendering of the KnpMenu package for Symfony2. From what I read, there should be a “current” class in the corresponding route element. I read the Knp documentation and they say something about RouteVoter, but I can't get it to work. Any ideas?
Builder Code:
<?php // src/Acme/DemoBundle/Menu/Builder.php namespace Acme\DemoBundle\Menu; use Knp\Menu\FactoryInterface; use Symfony\Component\DependencyInjection\ContainerAware; class Builder extends ContainerAware { public function mainMenu(FactoryInterface $factory, array $options) { $menu = $factory->createItem('root'); $menu->addChild('Home', array('route' => 'index')); $menu->addChild('About Me', array('route' => 'products')); return $menu; } }
php symfony menu knpmenubundle
acid
source share