[ 'optional' => ['index'], ], ]); } public function verbs() { return [ 'index' => ['POST'], ]; } public function actionIndex(): array { $model = new FeedbackForm(); $model->load(Yii::$app->request->post()); if (!$model->sendMessage()) { return [ 'success' => false, 'errors' => $model->getFirstErrors(), ]; } return [ 'success' => true, ]; } }