Пример #1
0
 /**
  * Creates a new Spisosnovakt model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Spisosnovakt();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Proc::RemoveLastBreadcrumbsFromSession();
         // Удаляем последнюю хлебную крошку из сессии (Создать меняется на Обновить)
         return $this->redirect(['update', 'id' => $model->spisosnovakt_id]);
     } else {
         $model->spisosnovakt_date = empty($model->spisosnovakt_date) ? date('Y-m-d') : $model->spisosnovakt_date;
         return $this->render('create', ['model' => $model]);
     }
 }