Okay, after a week of trying i finally found a way. Had to email to the guy who actually made the extension.
He suggested to make my own custom controller just for this, so here’s the code:
<?php
Yii::import('application.modules.user.models.*');
class AppUserController extends Controller
{
/**
* @return array action filters
*/
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
array('RestfullYii.filters.ERestFilter + REST.GET, REST.PUT, REST.POST, REST.DELETE'),
);
}
public function actions()
{
return array(
'REST.'=>'RestfullYii.actions.ERestActionProvider',
);
}
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function accessRules()
{
return array(
array('allow',
'actions'=>array('REST.GET', 'REST.PUT', 'REST.POST', 'REST.DELETE'),
'users'=>array('*'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
public function restEvents()
{
$this->onRest('model.instance', function() {
return new User();
});
}
}
Save as AppUserController.php
Throw it into <app>/protected/controller/ folder
Login into ur website, you can get All/Single user by doing requests:
Get all users / Get single user :
<app>/index.php/api/appUser/
<app>/index.php/api/appUser/1
i’m using your AppUserController to get the user details but how i post the data using restfullyii…if u have example code for contoller and model please provided to me…that’s help me …