phiamo / MopaBootstrapBundle

Easy integration of twitters bootstrap into symfony2
http://bootstrap.mohrenweiserpartner.de
709 stars 348 forks source link

issue with icons in navbar mene #366

Closed martiza closed 11 years ago

martiza commented 11 years ago

Hi there ,

I'm trying to get the icons in the navbar menu , however its papering for the drop-down menu but not for the Main this function generating the menu from my NavMenuBuilder

    public function createMainMenu(Request $request)
    {
        $menu = $this->factory->createItem('root');
        $menu->setCurrentUri($request->getRequestUri());
        $menu->setChildrenAttribute('class', 'nav');

        $menu->addChild('Home', array('route' => 'application_front_homepage',
            'extras' => array('icon' => 'home'),
            ));

        $dropdown = $this->createDropdownMenuItem($menu, "DropDownMenu" ,false ,  array('icon' => 'caret'));
        $dropdown->addChild('Dashpord', array('route' => 'sonata_admin_dashboard' ,'extras' => array('icon' => 'home')) );
        $this->addDivider($menu, true);

        return $menu;
    }

actually am trying to do something like this

http://bootsnipp.com/snipps/user-preferences-in-nav-bar

thanks in advance

phiamo commented 11 years ago

humm your code does not work for me, where did you get the extras from ?

phiamo commented 11 years ago

i updated the master version to support 2.3 style caret etc. have a look into sandboxbundle how to use it... http://bootstrap.mohrenweiserpartner.de/mopa/bootstrap/layout