I have a url pattern defined as below for a REST API build using yii.
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
array('api/default/list', 'pattern'=>'api/<model:\w+>', 'verb'=>'GET'),
array('api/default/view', 'pattern'=>'api/<model:\w+>/<id:\d+>', 'verb'=>'GET'),
array('api/default/update', 'pattern'=>'api/<model:\w+>/<id:\d+>', 'verb'=>'PUT'),
array('api/default/delete', 'pattern'=>'api/<model:\w+>/<id:\d+>', 'verb'=>'DELETE'),
array('api/default/create', 'pattern'=>'api/<model:\w+>', 'verb'=>'POST'),
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
What i am trying now is,
http://example.com/RestApi/index.php/api/post?offset=5&limit=10
The above works, but the following doesnt work.
http://example.com/RestApi/index.php/api/post/offset/5/limit/10
How can i make it work like second way? what changes needs to be done to the Url Manager ?
Thanks
Update
The error i get for second way is,
Unable to resolve the request "api/post/offset/5/limit/10".