I just tried knpLabs MenuBundle
I am not receiving the flag for the current item, I follower the turorial from https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/index.md
Here is my code
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('Innehåll', array('route' => 'Content'));
$menu->addChild('Skärmlayouter', array('route' => 'Layout'));
$menu->addChild('Media', array('route' => 'Media'));
$menu->addChild('Områden & fastigheter', array('route' => 'Container'));
$menu->addChild('Användare & behörigheter', array('route' => 'UserManagement'));
return $menu;
}
}
And here is what it produces:
<ul>
<li class="first">
<a href="/biztv_symfony/web/app_dev.php/Content/">Innehåll</a>
</li>
<li>
<a href="/biztv_symfony/web/app_dev.php/Layout/">Skärmlayouter</a>
</li>
<li>
<a href="/biztv_symfony/web/app_dev.php/Media/">Media</a>
</li>
<li>
<a href="/biztv_symfony/web/app_dev.php/Container/">Områden & fastigheter</a>
</li>
<li class="last">
<a href="/biztv_symfony/web/app_dev.php/UserManagement/">Användare & behörigheter</a>
</li>
</ul>
It claims to include the active link flag (by class "current") automatically, that's why I wanted to try this bundle, so I wouldn't have to meddle around coding that part.
Either I am missing a key point, or this documentation that I am following is missing a key part?