Form inside TbNavbar Dropdown Items

后端 未结 2 408
死守一世寂寞
死守一世寂寞 2021-01-22 05:12

I\'m trying to add a dropdown login form using Yii Bootstrap, like that attached tutorial, but I\'m not able to add HTML Form to TbNavbar items. How ca

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-22 06:06

    Additionally, to keep html markup to a minimum you can also use the 'template' array key:

    widget('bootstrap.widgets.TbNavbar',array(
    'items'=>array(
        array(
            'class'=>'bootstrap.widgets.TbMenu',
            'htmlOptions'=>array('class'=>'pull-right'),
            'items'=>array(
                array('label'=>'Login', 'url'=>'#', 'visible'=>Yii::app()->user->isGuest, 'items'=>array(
                    array(
                        'label'=>'{menu}',
                        'template'=>''
                    )
                )),
            ),
        ),
    ))); ?>
    

    Inside the defined template string you can also use the {menu} placeholder to be replaced with your link.

提交回复
热议问题