Yii Framework Forum: CMenu url item to root - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CMenu url item to root Rate Topic: -----

#1 User is offline   x3rx3s 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 31-October 10

Posted 31 October 2010 - 11:38 PM

Hi all,

I would like to know how to add an CMenu item that links to /

Right now, if I put
    <?php $this->widget('zii.widgets.CMenu',array(
      'id'=>'main_nav',
      'items'=>array(
        array('label'=>'Home', 'url'=>array('/'), 'active' => (($this->id=='site') && ($this->action->id=='index'))),


The / links it to the current page I'm at and not the actual root.

Please help.

Thanks
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 01 November 2010 - 02:19 AM

I can find any intelligent solution.

The best advice I have is:

'url'=>Yii::app()->baseUrl


This at least work correctly
0

#3 User is offline   x3rx3s 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 31-October 10

Posted 01 November 2010 - 09:09 PM

Thanks,

I end up just doing 'url'=>'/' , that worked!



View Postzaccaria, on 01 November 2010 - 02:19 AM, said:

I can find any intelligent solution.

The best advice I have is:

'url'=>Yii::app()->baseUrl


This at least work correctly

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users