Yii Framework Forum: urlManager and rules - Yii Framework Forum

Jump to content

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

urlManager and rules Rules are confusing me Rate Topic: -----

#1 User is offline   Muhammad Nauman Yousaf 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 06-February 12

Posted 27 July 2012 - 05:08 AM

Can any one tell me about the urlManager's rules:

'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

why we can only use id as a parameter? what if i want group_id or some thing else which is generic.
0

#2 User is offline   twisted1919 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 644
  • Joined: 23-October 10
  • Location:Romania

Posted 27 July 2012 - 05:17 AM

you can use:
'<controller:\w+>/<group_id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<group_id:\d+>' => '<controller>/<action>',

without any problem. You have to remember that instead of $id you'll use $group_id, and that's all.
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