Yii Framework Forum: Url Rule To Catch All? - Yii Framework Forum

Jump to content

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

Url Rule To Catch All?

#1 User is offline   alex-w 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 233
  • Joined: 25-November 10

Posted 12 February 2014 - 12:00 PM

Not sure if catch all is the right term but I'm trying to do the following rule.

In Yii 1 I could do
'<action:\w+>/*' => 'site/<action>'

But this doesn't seem to work in Yii 2.
0

#2 User is offline   ORey 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,703
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 12 February 2014 - 12:07 PM

Yes, but you can give regexp a name

'<action:\w+>/<data:.*>' => 'site/<action>'


and it works.
God is real unless declared as integer
1

#3 User is offline   alex-w 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 233
  • Joined: 25-November 10

Posted 12 February 2014 - 12:19 PM

Thanks, That's what I was after.

Done it so it would work with and without extra pathinfo.
'<action:\w+><data:(.*)?>' => 'site/<action>',

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