Yii Framework Forum: Url Writing Just Like Cake Php - Yii Framework Forum

Jump to content

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

Url Writing Just Like Cake Php Rate Topic: -----

#1 User is offline   nirmalroka 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 52
  • Joined: 10-July 12
  • Location:Kathmandu Nepal

Posted 25 November 2012 - 06:27 AM

Hi I had faced problem in url writing just like in cake php, In cake php I can use routes for different url
such if post/create, than i can write in in cake php as create/post so look which url is the best


post/create

or create/post ( in cake php)

I had searched all over the internet but i didn't get it. If this features was not in Yii than please add this type url writing in yii next version .Thank you
0

#2 User is offline   drylko 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 13-September 09
  • Location:Poland

Posted 25 November 2012 - 07:08 AM

View Postnirmalroka, on 25 November 2012 - 06:27 AM, said:

Hi I had faced problem in url writing just like in cake php, In cake php I can use routes for different url
such if post/create, than i can write in in cake php as create/post so look which url is the best


post/create

or create/post ( in cake php)

I had searched all over the internet but i didn't get it. If this features was not in Yii than please add this type url writing in yii next version .Thank you



In a company where I'm working we're doing things with cakephp (2.x). I haven't seen this kind of routes, though. When following conventions you always stays with controller/action. But to achieve what you want with yii, you can write default routes in config/main.php like this:
array(
    '<action:\w+>/<controller:\w+>'=>'<controller>/<action>',
    '<controller:\w+>'=>'<controller>',
)


By the way, routing system in yii is very well thought and you can achieve almost everything, if not everything, with it.

Cheerio
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