[ 'class' => VerbFilter::class, 'actions' => [ 'delete' => ['post'], ], ], ]; } public function actionIndex() { $searchModel = new OauthSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); } public function actionCreate() { $model = new OauthClients(); $model->grant_types = "client_credentials authorization_code password implicit refresh_token"; if ($model->load(Yii::$app->request->post()) && $model->save(true)) { return $this->redirect(['index']); } else { return $this->render('create', [ 'model' => $model, ]); } } public function actionUpdate($id) { $model = new OauthForm(); $model->setModel($this->findModel($id)); if ($model->load(Yii::$app->request->post()) && $model->save(false)) { return $this->redirect(['index']); } return $this->render('update', [ 'model' => $model ]); } public function actionDelete($id) { $this->findModel($id)->delete(); return $this->redirect(['index']); } protected function findModel($id) { if (($model = OauthClients::findOne(['client_id' => $id])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } } }