public function actionCreate() { $model = new Holiday('insert'); $semester = Semesters::model()->actual(); if (Yii::app()->request->isPostRequest) { $holiday = Yii::app()->request->getParam('Holiday'); $model->setAttributes($holiday); if ($model->save()) { Yii::app()->user->setFlash('success', 'Выходной успешно создан'); $this->redirect(['index']); } } $this->render('form', ['model' => $model, 'semester' => $semester]); }