Reputation: 11088
My current url manager:
'urlManager'=>array(
'showScriptName'=>false,
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'rest/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'rest/<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
With regards to the rest route
http://htt.local/rest/v1/show/2916
works!!
http://htt.local/rest/v1/candle/2916/from/2015-12-23
Unable to resolve request
Upvotes: 0
Views: 81
Reputation: 8033
Your url manager should be like this:
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'rest/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
/* Add this line */
'rest/<controller:\w+>/<action:\w+>/<id:\d+>/from/<date>'=>'<controller>/<action>',
/* */
'rest/<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
Upvotes: 1