Example #1
0
 /**
  * Выводим оформление товаров
  *
  * @return mixed
  */
 public function actionOrder()
 {
     $model = new OrderForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         if ($model->sendEmail(Yii::$app->params['adminEmail'])) {
             //Yii::$app->session->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.');
             return $this->render('success');
         } else {
             Yii::$app->session->setFlash('error', 'There was an error sending email.');
         }
         return $this->refresh();
     } else {
         return $this->render('order', ['model' => $model]);
     }
 }