/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new Teacher(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Teacher'])) { $model->attributes = $_POST['Teacher']; if ($model->save()) { Yii::app()->user->setFlash('info', '<span class="single-name">' . $model->singleName() . 'а</span> <b>' . $model->surname . ' ' . $model->initials . '</b> ' . Yii::app()->params['postActions'][Yii::app()->controller->action->id] . '!'); $this->redirect(array('/teacher/admin')); } } $this->render('create', array('model' => $model)); }