Remove regular expressions from URL

Now url manager work with regular expressions:




array(

    'articles'=>'article/list',

    'article/<id:\d+>/*'=>'article/read',

)



But, … php is variant. We do not care about type of var. We just need to know var name.




array(

    'articles'=>'article/list',

    'article/<id>/*'=>'article/read',

)



Regular expression has a big use in the url manager when you need to build complex urls, an example when creating SEO urls. Your url might be mysite.com/my-pretty-title-234

you may only need the 234 as that is the id (imagine this is a crud controller). Regex is a valuable tool here for parsing such things.

I agree with Jaggi.

If sensorario’s proposition is to be implemented, it could be in the form of a default regex (something like this: “.+?(?=/|$)”) for rules without one.

Moreover, regexps are not the fastest thing on earth.

not the slowest either

I completely agree that regex definitions in the url rules should be kept. They have a fundamental role in the rules.

But Yii is a "high performance framework" not a "not so slow framework"…

With opinions like that, it could easily turn into a “no features framework” as well ;)

With opinions like that, it’s a “no slow features framework” ;)