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.
-
restfullyii[1] claims it only supports Yii 1.8+. Which is weird, since it doesn’t exist.
-
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!