Exemplo n.º 1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Statut();
     if (isset($_POST['Statut'])) {
         $model->attributes = $_POST['Statut'];
         if ($model->save()) {
             Yii::app()->user->setFlash('success', Yii::t('main', 'Данные успешно сохранены!'));
             $this->redirect(array('update', 'id' => $model->id));
         } else {
             Yii::app()->user->setFlash('error', Yii::t('main', 'Ошибка сохранения данных!'));
         }
     }
     $this->render('create', array('model' => $model));
 }