Oleg Shakhov
Oleg Shakhov

Reputation: 23

Yii transform url from param/param/param/ to param/param?param

Suppose I have a url like:

site.com/param1/value1/param2/value2/param3/value3/param4/value4

I need to convert this url when a user writes it in url line to:

site.com/param1/value1/param2/value2?param3=value3&param4=value4

P.S. - the number of parameters is variable.

How can I do it?

Upvotes: 0

Views: 37

Answers (1)

osmancode
osmancode

Reputation: 291

You need to change the UrlManager Rules according to the situation. You need to configure the Url manager to handle the first two params as path url and let the rest

Upvotes: 1

Related Questions