Пример #1
0
 public function actionIndex()
 {
     $model = new FeedbackModel();
     $request = Yii::$app->request;
     if ($model->load($request->post())) {
         $returnUrl = $model->save() ? $request->post('successUrl') : $request->post('errorUrl');
         return $this->redirect($returnUrl);
     } else {
         return $this->redirect(Yii::$app->request->baseUrl);
     }
 }
Пример #2
0
 public function actionAwarness()
 {
     $model = new FeedbackModel();
     $request = Yii::$app->request;
     $Saved = 0;
     if ($model->load($request->post())) {
         if ($model->save()) {
             //var_dump($model->getErrors());
             $Saved = 1;
         }
     }
     return $this->render('awarness', array('model' => $model, 'Saved' => $Saved));
 }