Menu/DemoMenuBuilder.php
public function getSubMenu(Factory $factory, Helper $helper)
    {
        $menu = $this->getNormalMenu($factory, $helper);
        $products = $menu->getChild('Products');

        // Add header
        $helper->addHeader($products, 'Products A');
        // Set submenu for products
        $helper->setSubmenu($products);
        $products->addChild('Product 1', ['route' => 'homepage']);
        $products->addChild('Product 2', ['route' => 'homepage']);
        $products->addChild('Product 3', ['route' => 'homepage']);
        // Add header
        $helper->addHeader($products, 'Products B');
        $products->addChild('Product 4', ['route' => 'homepage']);
        $products->addChild('Product 5', ['route' => 'homepage']);
        $products->addChild('Product 6', ['route' => 'homepage']);

        return $menu;
    }
public function getSubMenu(Factory $factory, Helper $helper)
    {
        $menu = $this->getNormalMenu($factory, $helper);
        $products = $menu->getChild('Products');

        // Add header
        $helper->addHeader($products, 'Products A');
        // Set submenu for products
        $helper->setSubmenu($products);
        $products->addChild('Product 1', ['route' => 'homepage']);
        $products->addChild('Product 2', ['route' => 'homepage']);
        $products->addChild('Product 3', ['route' => 'homepage']);
        // Add header
        $helper->addHeader($products, 'Products B');
        $products->addChild('Product 4', ['route' => 'homepage']);
        $products->addChild('Product 5', ['route' => 'homepage']);
        $products->addChild('Product 6', ['route' => 'homepage']);

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

@return \Knp\Menu\ItemInterface