public function actionCallOrder() { $model = new CallorderForm(); if (\Yii::$app->request->isAjax && $model->load($_POST)) { \Yii::$app->response->format = Response::FORMAT_JSON; return ActiveForm::validate($model); } if ($model->load(\Yii::$app->request->post()) && $model->order()) { \Yii::$app->session->setFlash('contactFormSubmitted'); return $this->redirect(Url::previous()); } }
public function actionCallOrder() { $model = new CallorderForm(); if (\Yii::$app->request->isAjax && $model->load($_POST)) { \Yii::$app->response->format = Response::FORMAT_JSON; return ActiveForm::validate($model); } if ($model->load(\Yii::$app->request->post()) && $model->order()) { \Yii::$app->session->setFlash('success', Language::t('flash', 'Ваш заказ успешно принят и будет рассмотрен в ближайшее время.')); return $this->redirect(Url::previous()); } }