Creating your first menu
Let's see how to create a bootstrap style menu. The menu feature of MopaBootstrapBundle is totally handled by KnpMenuBundle. Here are the required steps to create a menu:
Go to your AppBundle and create a new folder called
Menu
.Add a new class and name it
Builder.php
; the contents of this class should be as follows:<?php // mava/src/AppBundle/Menu/Builder.php namespace Mava\CoreBundle\Menu; use Knp\Menu\FactoryInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; class Builder extends ContainerBuilder { public function topMenu(FactoryInterface $factory, array $options) { $menu = $factory->createItem('root'); $menu->setChildrenAttribute('class', 'nav navbar-top-links navbar-right'); $dropdown2 = $menu->addChild(' ', array( 'icon' => 'bell', 'dropdown' => true, 'caret' => true, )); // Create a dropdown header $dropdown2->addChild('notifications...