public function actionAdd() { $model = new QuestionModel(); $msg = ''; if (!empty($_POST['QuestionModel'])) { $model->attributes = $_POST['QuestionModel']; if ($model->validate()) { $model->user_id = Yii::app()->user->getId(); $model->save(); $msg = 'Спасибо за Ваш вопрос. Стоимость вопроса ' . $model->getCost(); } } $this->render('add', ['model' => $model, 'msg' => $msg]); }