2
I am starting a project in the company where I develop, and we are being thank you using the Yii Framework along with the Bootstrap, but I’m not getting the icons of Bootstrap (glyphicon-bootstrap
) in the menu, follow example of the code:
$this->widget('zii.widgets.CMenu',
array('htmlOptions'=>array("class"=>"nav", "id"=>"side-menu"), 'items'=>array(
array('label'=>'Home', 'url'=>array('/site/index')),
array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
array('label'=>'Contact', 'url'=>array('/site/contact'), 'className '=>'tafaera'),
array('label'=>'Charts', 'url'=>array('/submenu/sub0'),
'submenuOptions'=>array('class'=>'nav nav-second-level'),
'items'=>array(
array('label'=>'Sub 1.1','tag'=>'tafarel' ,'url'=>array('/submenu/sub1')),
array('label'=>'Sub 1.2', 'url'=>array('/submenu/sub2')),
array('label'=>'Sub 1.3','url'=>array('/submenu/sub3')
)
)
),
array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
array('label'=>'Hola', 'url'=>array('/hola/index')),
array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
),
));
It didn’t work... Yii still doesn’t recognize the <i class="" tag of the bootstrap, it puts the text instead of the icon
– Tafarel_Brayan
I think it’s the place that’s wrong, I changed the place take a look! see if it works @Tafarel_brayan
– user6026
Now, it worked out.... i tbm did a test going to: framework>Zii>widgets>Cmenu.php There is a public option $encodeLabel=true; and put with ofalse and tbm worked !
– Tafarel_Brayan
@Tafarel_brayan was really the place is that it is so much array that I got lost kkkkk but, that good worked out solves the issue ....
– user6026
I’m a beginner... ?
– Tafarel_Brayan