Zorba
(Pawel Korba)
1
Hello
How to pass absolute url to CMenu item? By default url parameter goes to CHtml::normalizeUrl which uses Yii::app()->createUrl so with this code:
‘url’ => array(‘http://external-link.com’)
I get http://applicationdomain.com/http://external-link.com instead of just http://external-link.com
Thanks
Paweł
dito_ch
(R Fuerst)
2
Hello Pawel
Pass the url as a string, not in an array. See CMenu documentation for more info on how to specify this parameter.
sensorario
(Sensorario)
3
Et voilà:
$this->widget('zii.widgets.CMenu', array(
'items'=>array(
array('label'=>'Google', 'url' => 'http://www.google.com')
),
));
Zorba
(Pawel Korba)
4
Thanks guys, I guess it was too easy to figure it out by myself 