Yii Framework Forum: Create Url - Yii Framework Forum

Jump to content

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

Create Url Need to change in URL Rate Topic: -----

#1 User is offline   shivanshu 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 17-March 13
  • Location:India

Posted 22 April 2013 - 07:33 AM

Hi All,

I have Menu in Main.php like
<?php $this->widget('zii.widgets.CMenu',array(
'items'=>array(
array('label'=>'Charts', 'url'=>array('/media/index')),
Which is redirect to localhost/demo/index/media/index
instead of it i want it to be localhost/demo/index.

Please tell me how to do so.Thanks in advance.
0

#2 User is offline   Fabrizio Caldarelli 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 306
  • Joined: 21-March 13
  • Location:Rome, Italy

Posted 22 April 2013 - 07:49 AM

What is your basePath ? What is your url format config (at config/main.php) ?

You can try to set:

array('label'=>'Charts', 'url'=>array('media/index')),


(without slash at start of media)
0

#3 User is offline   Ghanshyam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 18-March 13
  • Location:Ahmedabad

Posted 22 April 2013 - 07:50 AM

Hello,
Please try like this.
array('label'=>'Charts', 'url'=>CController::createUrl('/media/index')),

0

#4 User is offline   shivanshu 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 17-March 13
  • Location:India

Posted 22 April 2013 - 08:17 AM

Not working.
And yes my URL config is config.php default.no changes.
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