I have a Rest API in Yii2, and Yii generates all actions
view / update / create / delete
I want to change the comportement of createMethode et garde the othe
Or you can do by following this step :
public function actions() { $actions = parent::actions(); // will overriding return data on the index action $actions['index']['prepareDataProvider'] = [new app/models/Post(), 'getAllPost']; return $actions; }