diff --git a/frontend/controllers/FeedbackController.php b/frontend/controllers/FeedbackController.php new file mode 100644 index 0000000..ed4f29b --- /dev/null +++ b/frontend/controllers/FeedbackController.php @@ -0,0 +1,42 @@ + [ + 'class' => Cors::className(), + ], + ]; + } + + public function actionIndex() + { + \Yii::$app->response->format = Response::FORMAT_JSON; + + if (\Yii::$app->request->isPost) { + $model = new Feedback(\Yii::$app->request->post()); + if ($model->validate() && $model->save()) { + return [ + 'status' => true, + 'message' => 'Success', + ]; + } + } + + return [ + 'status' => false, + 'message' => 'Error', + ]; + } + } \ No newline at end of file -- libgit2 0.21.4