I have a controller named Notes in modules admin.
i.e, The path is app/protected/modules/admin/controllers/NotesController
I want to apply restfull service to this controller.
I had installed the extensions named RESTFullYii ,
the link is http://www.yiiframework.com/extension/restfullyii , and i had followed the instructions to install this extensions,
I had create a sample test controller in protected/controller folder ,and when i tried it with below functions inside controller,
public function restEvents() {
$this->onRest('model.instance', function() {
return new ProfileNotes();
});
}
it throws output as {"success":false,"message":"Unauthorized","data":{"errorCode":401,"message":"Unauthorized"}}
if i tried it with
public function restEvents() {
$this->onRest('req.auth.ajax.user', function() {
return true;
});
}
it’s working and outputs the json data.
the url for that is localhost/example/api/Sample
But the problem is when i tried to apply the same feature to controllers inside module
it throwing the error,
CHttpException
The system is unable to find the requested action "error"
the url is localhost/example/admin/api/Notes
iam doing anything wrong ,
Anyone had successfully implemented the restfull service inside modules.