restfullyii and POST GET requests

I am stepping back into Yii after some time for a project that was recently brought back to life. It runs on Yii 1.1 and I am trying to implement the restfullyii[1] component and having an issue with POST/GET operations. I’ve gone through the installation instructions over and over, so now I am turning to the Yii community for help.

  1. restfullyii[1] claims it only supports Yii 1.8+. Which is weird, since it doesn’t exist.

  2. Appears to be route-related as when I remove the "GET" routes (list, view), the "POST" routes (create, update) work fine. When I put the "GET" routes back and I do an update to a record, it gives me a list of the records in the table instead of executing the update.

Here are my routes:

‘api/<controller:\w+>’=>array(’<controller>/restList’, ‘verb’=>‘GET’),

‘api/<controller:\w+>/<id:\w+>’=>array(’<controller>/restView’, ‘verb’=>‘GET’),

‘api/<controller:\w+>/<id:\w+>/<var:\w+>’=>array(’<controller>/restView’, ‘verb’=>‘GET’),

array(’<controller>/restUpdate’, ‘pattern’=>‘api/<controller:\w+>/<id:\d+>’, ‘verb’=>‘PUT’),

array(’<controller>/restDelete’, ‘pattern’=>‘api/<controller:\w+>/<id:\d+>’, ‘verb’=>‘DELETE’),

array(’<controller>/restCreate’, ‘pattern’=>‘api/<controller:\w+>’, ‘verb’=>‘POST’),

array(’<controller>/restCreate’, ‘pattern’=>‘api/<controller:\w+>/<id:\w+>’, ‘verb’=>‘POST’),

‘<controller:\w+>/<id:\d+>’=>’<controller>/view’,

‘<controller:\w+>/<action:\w+>/<id:\d+>’=>’<controller>/<action>’,

‘<controller:\w+>/<action:\w+>’=>’<controller>/<action>’,

Any help would be appreciated!

[1] http://www.yiiframework.com/extension/restfullyii

bump

I wouldn’t use an extension, the following is a nice wiki who can provide you with the insights to create your own way to do your own API lib.

http://www.yiiframework.com/wiki/175/how-to-create-a-rest-api

Cheers