Template for REST API controller in Yii 1
APPLICATION_ID
, and add your models in each action in the switch-case statement (remove the MyModel example before that)'urlManager' => array(
'urlFormat' => 'path',
'showScriptName' => false,
'caseSensitive' => true,
'rules' => array(
//API rules
array('api/list', 'pattern'=>'api/<model>', 'verb'=>'GET'),
array('api/view', 'pattern'=>'api/<model>/<id:\d+>', 'verb'=>'GET'),
array('api/update', 'pattern'=>'api/<model>/<id:\d+>', 'verb'=>'PUT'),
array('api/delete', 'pattern'=>'api/<model>/<id:\d+>', 'verb'=>'DELETE'),
array('api/create', 'pattern'=>'api/<model>', 'verb'=>'POST'),
),
),