Hi Yii!!
I have a TbNavbar with TbMenu and a login widget inside an item, the problem is the widget show the content out of the TbMenu, in the <body>, how can i load the content inside an TbMenu item?
This is my code
$this->widget('bootstrap.widgets.TbNavbar', array(
'type'=>null, // null or 'inverse'
'brand'=>'My App',
'brandUrl'=>'#',
'collapse'=>true, // requires bootstrap-responsive.css
'items'=>array(
array(
'class'=>'bootstrap.widgets.TbMenu',
'items'=>array(
array('label'=>'Home', 'url'=>array('/site/page', 'view'=>'about')),
array('label'=>'Board', 'url'=>'#'),
array('label'=>'News', 'url'=>'#'),
array('label'=>'Login', 'url'=>'#', 'items'=>array(
$this->widget('application.modules.user.components.LoginWidget'),
array('label'=>'Sing Up', 'url'=>'#'),
)),
),
),
),
The result is:
and the output code is:
.....
<body>
<div class="portlet" id="yw3">
<div class="portlet-decoration">
<div class="portlet-title">Login</div>
</div>
<div class="portlet-content">
<form action="/user/auth" method="post"><input type="hidden" value="//news/news/view" name="quicklogin" id="quicklogin">
<div class="row">
<label for="YumUserLogin_username">Name</label> <input size="10" name="YumUserLogin[username]" id="YumUserLogin_username" type="text"> </div>
<div class="row" style="padding-top:12px;">
<label for="YumUserLogin_password">Password</label> <input size="10" name="YumUserLogin[password]" id="YumUserLogin_password" type="password"> </div>
<div class="row" style="font-size:10px;">
<a href="/registration/registration/recovery">Lost password?</a> </div>
<div class="row submit">
<input type="submit" name="yt1" value="Login"> </div>
</form></div>
</div>
.......
I want the widget code inside the menu item:
<li class="dropdown open">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Login <span class="caret"></span></a>
<ul id="yw5" class="dropdown-menu">
<li class="divider"></li>
//<----Here must be the widget code!
<li><a tabindex="-1" href="#">Sing up</a></li>
</ul>
</li>
But i want something like:
I have also tried with:
$this->widget('bootstrap.widgets.TbNavbar', array(
'type'=>null, // null or 'inverse'
'brand'=>'My App',
'brandUrl'=>'#',
'collapse'=>true, // requires bootstrap-responsive.css
'items'=>array(
array(
'class'=>'bootstrap.widgets.TbMenu',
'items'=>array(
array('label'=>'Home', 'url'=>array('/site/page', 'view'=>'about')),
array('label'=>'Board', 'url'=>'#'),
array('label'=>'News', 'url'=>'#'),
)),
),
),
'<ul class="nav pull-left">
<li class="divider-vertical"></li>
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown">Sign In <strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">'.
$this->widget('application.modules.user.components.LoginWidget')
.'</div>
</li>
</ul>',
),
But in this case the error is:
Thanks Yii!!