can anyone tell me how to override actioncreate and actionupdate method yii2 rest api..
class CabController extends ActiveController
{
public $modelClass = 'api\modules\v1\models\Cab';
public function actions(){
$actions = parent::actions();
unset($actions['create']);
unset($actions['update']);
return $actions;
}
public function actionCreate(){
Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
$model = $this->modelClass;
$model->load(Yii::$app->request->post());
$cur_time = date('Y-m-d H:i:s');
$model->date_created = $cur_time;
$$model->save(false);
}
If i do like this mean i got error like 500 internal server error and error message like Call to a member function load() on a non-object ..how to solve this issue.. Thanks...