php - Yii: The URL pattern for route is not a valid regular expression -
i've got strange problem. have simple routes configured worked on local server (php 5.3 , 5.4, both work fine) on deployment server (php 5.3.23) failed, switched default routes preconfigured yii (even though i'm pretty sure mine correct), fail following exception the url pattern "<controller:\w+>/<id:\d+>" route "<controller>/view" not valid regular expression.
here routes:
'urlmanager'=>array( 'urlformat'=>'path', 'rules'=>array( //'^$' => 'site/index', //'<view:[\w\-\_\d]+>' => 'site/paged', '<controller:\w+>/<id:\d+>'=>'<controller>/view', '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', '<controller:\w+>/<action:\w+>'=>'<controller>/<action>', ), 'showscriptname' => true, ), as can see i've commented out 2 routes make sure didn't made stupid mistake.
what wrong?
here's backtrace if anyone's interested http://i.imgur.com/z0htioq.png
well, seems yii complains on part <controller>/view. url rules can use special placeholders _ prefix, module, controller, action - respectively _m, _c, _a. in case use that:
'urlmanager'=>array( 'urlformat'=>'path', 'rules'=>array( //'^$' => 'site/index', //'<view:[\w\-\_\d]+>' => 'site/paged', '<_c>/<id:\d+>'=>'<_c>/view', '<_c>/<_a>/<id:\d+>'=>'<_c>/<_a>', '<_c>/<_a>'=>'<_c>/<_a>', ), 'showscriptname' => true, ),
Comments
Post a Comment