I’m developing a CMS using Yii Framework. In developing the theme I have a problem. In the menus I have some special characters (The website is in Italian). the HTML markups for special characters doesn’t work for menu items. And if I put the character itself it looks different. Here is my code:
<div class="horizontal-menu">
<?php $this->widget('zii.widgets.CMenu',array(
'items'=>array(
array('label'=>'LE ATTIVITÀ', 'url'=>array('/site/page', 'view'=>'attivita')),
array('label'=>'NEWS', 'url'=>array('/site/page', 'view'=>'news')),
),
)); ?>
LE ATTIVITÀ is the one making the problem. How can I show special characters here?
CMenu‘s labels are HTML-encoded by default, so you should use
array('label'=>'LE ATTIVITÀ', 'url'=>array('/site/page', 'view'=>'attivita')),.However if you must use HTML-encoded strings in your code, you can turn the encoding off by setting the
encodeLabelto false, like this$this->widget('zii.widgets.CMenu',array('items'=>array(),
'encodeLabel'=>false,
),