My Current Navigation code is as follows
<?php $this->widget('zii.widgets.CMenu',array(
'htmlOptions'=>array('class'=>'pull-right nav'),
'submenuHtmlOptions'=>array('class'=>'dropdown-menu'),
'itemCssClass'=>'item-test',
'encodeLabel'=>false,
'items'=>array(
array('label'=>'Create Account', 'url'=>array('/site/Register'),'visible'=>Yii::app()->user->isGuest),
array('label'=>'Login','url'=>"#loginModal", 'visible'=>Yii::app()->user->isGuest),
array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
),
)); ?>
renders the following in HTML
<ul class="pull-right nav" id="yw1">
<li class="item-test"><a href="/boatapp/site/Register">Create Account</a></li>
<li class="item-test"><a href="#loginModal">Login</a></li>
</ul>
Now I want to just insert data-toggle="modal" in the login link.. how do I generate HTML as below>
<ul class="pull-right nav" id="yw1">
<li class="item-test"><a href="/boatapp/site/Register">Create Account</a></li>
<li class="item-test"><a **data-toggel="modal"** href="#loginModal">Login</a></li>
</ul>
Give this a try:
array('label'=>'Login','url'=>"#loginModal", 'visible'=>Yii::app()->user->isGuest, 'linkOptions' => array('data-toggle'=>'modal')),