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 can I adapt it?
Followed Tutorial: http://mifsud.me/adding-dropdown-login-form-bootstraps-navbar/
Code:
<?php $this->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(
'FORM HTML CODE', // here is the problem, the HTML Form is not working.
)),
),
),
)); ?>
Additionally, to keep html markup to a minimum you can also use the 'template' array key:
Inside the defined template string you can also use the {menu} placeholder to be replaced with your link.
Move your button and form out of the
TbMenu
items array and into theTbNavbar
items array.TbNavBar
allows for html but notTbMenu
.