Answer the question
In order to leave comments, you need to log in
Does CMenu (Yii) support images?
$this->widget('zii.widgets.CMenu', array(
'items'=>array(
// Important: you need to specify url as 'controller/action',
// not just as 'controller' even if default acion is used.
array('label'=>'Home', 'url'=>array('site/index')),
// 'Products' menu item will be selected no matter which tag parameter value is since it's not specified.
array('label'=>'Products', 'url'=>array('product/index'), 'items'=>array(
array('label'=>'New Arrivals', 'url'=>array('product/new', 'tag'=>'new')),
array('label'=>'Most Popular', 'url'=>array('product/index', 'tag'=>'popular')),
)),
array('label'=>'Login', 'url'=>array('site/login'), 'visible'=>Yii::app()->user->isGuest),
),
));
Answer the question
In order to leave comments, you need to log in
Yes.
to do this, turn off label coding
$this->widget('zii.widgets.CMenu', array(
'encodeLabel'=>false,
...
array('label'=>CHtml::encode($you_var))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question