Сообщение Об Ошибке Валидации

Подскажите как в случае с integerOnly изменить сообщение об ошибке, если введено не число?




array('year', 'numerical', 'integerOnly' => true, 'min' => 1901, 'max' => date('Y'), 'tooSmall' => 'Недопустимое значение', 'tooBig' => 'Недопустимое значение'),



Для такого случая используется атрибут message

Вот как в коде подставляются сообщения:





	protected function validateAttribute($object,$attribute)

	{

		$value=$object->$attribute;

		if($this->allowEmpty && $this->isEmpty($value))

			return;

		if($this->integerOnly)

		{

			if(!preg_match($this->integerPattern,"$value"))

			{

				$message=$this->message!==null?$this->message:Yii::t('yii','{attribute} must be an integer.');

				$this->addError($object,$attribute,$message);

			}

		}

		else

		{

			if(!preg_match($this->numberPattern,"$value"))

			{

				$message=$this->message!==null?$this->message:Yii::t('yii','{attribute} must be a number.');

				$this->addError($object,$attribute,$message);

			}

		}

		if($this->min!==null && $value<$this->min)

		{

			$message=$this->tooSmall!==null?$this->tooSmall:Yii::t('yii','{attribute} is too small (minimum is {min}).');

			$this->addError($object,$attribute,$message,array('{min}'=>$this->min));

		}

		if($this->max!==null && $value>$this->max)

		{

			$message=$this->tooBig!==null?$this->tooBig:Yii::t('yii','{attribute} is too big (maximum is {max}).');

			$this->addError($object,$attribute,$message,array('{max}'=>$this->max));

		}

	}



Спасибо, message то и забыл проверить :)