2

I'm using http://yii-booster.clevertech.biz/components.html#navbar and I want to generate navbar. I have a problem with that because I have to use pull-right css class on one of the items.

Why does htmlOptions not work? How to use pull-right on item "User"?

$this->widget('bootstrap.widgets.TbNavbar', array(
    'brand' => CHtml::encode($this->pageTitle),
    'brandUrl' => '#',
    'collapse' => true,
    'type' => 'inverse',
    'items' => array(
        array(
            'class' => 'bootstrap.widgets.TbMenu',
            'items' => array(
                array('label'=>'Home', 'url'=>'#', 'active'=>true),
                array('label'=>'Link', 'url'=>'#'),
                array('label'=>'Link', 'url'=>'#'),
                array('label'=>'User (895)', 'htmlOptions'=>array('class'=>'pull-right'),
                    'items'=>array(
                        array('label'=>'Support', 'url'=>'#'),
                        array('label'=>'Mailing', 'url'=>'#'),
                        array('label'=>'Sklep', 'url'=>'#'),
                        array('label'=>'Profile', 'url'=>'#'),
                        array('label'=>'Logout', 'url'=>'#'),
                    )
                ),
            )
        )
    )
));
Paolo Stefan
  • 10,112
  • 5
  • 45
  • 64
kabra
  • 1,306
  • 1
  • 17
  • 24
  • The array you build under 'items' is transformed into
  • elements and each of them is floated left so they are formed into a menu with links in a single row. It doesn't really makes sense to try to float of them right. Or you want to do something else?
  • – Yasen Feb 17 '13 at 15:46
  • see https://github.com/clevertech/YiiBooster/issues/76 – Rachel Gallen Feb 17 '13 at 15:49
  • you have to add '' at the bottom of your php – Rachel Gallen Feb 17 '13 at 15:50
  • and 'fixed' => TbNavbar::FIXED_TOP, at the top – Rachel Gallen Feb 17 '13 at 15:51