Menu/DemoMenuBuilder.php
public function getNormalMenu(Factory $factory, Helper $helper)
    {
        // Create root item
        $menu = $factory->createItem('root');

        // Add menu items
        $menu->addChild('Home', ['route' => 'homepage']);
        $menu->addChild('About', ['route' => 'homepage'])->setCurrent(true);
        $products = $menu->addChild('Products', ['route' => 'homepage']);
        $menu->addChild('Reference', ['route' => 'homepage'])->setAttribute('class', 'disabled');
        // Add vertical divider
        $helper->addDivider($menu, true);
        $contact = $menu->addChild('Contact', ['route' => 'homepage']);

        // Set badge for products
        $helper->setBadge($products, 2, 'important', true);

        // Set dropdown menu for contact
        $helper->setDropdown($contact);
        $contact->addChild('Test 1', ['route' => 'homepage']);
        $contact->addChild('Test')->setAttribute('class', 'nav-header');
        $contact->addChild('Test 2', ['route' => 'homepage']);
        // Add horizontal divider
        $helper->addDivider($contact);
        $contact->addChild('Test 3', ['uri' => 'http://www.imatic.cz']);

        return $menu;
    }
public function getNormalMenu(Factory $factory, Helper $helper)
    {
        // Create root item
        $menu = $factory->createItem('root');

        // Add menu items
        $menu->addChild('Home', ['route' => 'homepage']);
        $menu->addChild('About', ['route' => 'homepage'])->setCurrent(true);
        $products = $menu->addChild('Products', ['route' => 'homepage']);
        $menu->addChild('Reference', ['route' => 'homepage'])->setAttribute('class', 'disabled');
        // Add vertical divider
        $helper->addDivider($menu, true);
        $contact = $menu->addChild('Contact', ['route' => 'homepage']);

        // Set badge for products
        $helper->setBadge($products, 2, 'important', true);

        // Set dropdown menu for contact
        $helper->setDropdown($contact);
        $contact->addChild('Test 1', ['route' => 'homepage']);
        $contact->addChild('Test')->setAttribute('class', 'nav-header');
        $contact->addChild('Test 2', ['route' => 'homepage']);
        // Add horizontal divider
        $helper->addDivider($contact);
        $contact->addChild('Test 3', ['uri' => 'http://www.imatic.cz']);

        return $menu;
    }
@param Factory $factory
@param Helper  $helper

@return \Knp\Menu\ItemInterface