Example #1
0
 public function actionCreate()
 {
     $model = new Authitem();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Proc::RemoveLastBreadcrumbsFromSession();
         // Удаляем последнюю хлебную крошку из сессии (Создать меняется на Обновить)
         return $model->type == 1 ? $this->redirect(['update', 'id' => $model->name]) : $this->redirect(Proc::GetLastURLBreadcrumbsFromSession());
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }