Добрый день, возникла проблемка с методом setFlash. Вызываю так:
public function actionAdd() {
$rooms = new Rooms();
if(isset($_POST['Rooms'])) {
$rooms->setAttributes($_POST['Rooms']);
if($rooms->validate()) {
Yii::app()->user->setFlash('rooms_add_success', 'Комната успешно добавлена.');
// тут идет добавление базу
}
}
$this->render('add', array('room' => $rooms));
}
выдаёт следующую ошибку:
CWebApplication does not have a method named "user".
Source File
CComponent.php(266)
причем в конфиге прописано следующее:
'components' => array(
'user' => array(
'class' => 'WebUser',
// enable cookie-based authentication
'allowAutoLogin' => true,
),
Класс WebUser наследует CWebUser и имеет метод init()
public function init() {
parent::init();
//$this->_user = User::model()->findByPk($this->getId());
Yii::app()->getSession()->open();
if ($this->getIsGuest() and $this->allowAutoLogin) {
$this->restoreFromCookie();
}
$this->updateFlash();
}
может кто-то подсказать в чем проблема?