<?php
class Custom extends CFormModel
{
	public $message;
	
	public function rules(){
		return array(
			 array('message', 'required', 'on'=>'suggest', 'message'=>Yii::t("main","36_cannot_be_blank")), 
			 array('message', 'match', 'pattern' => '/^[a-z0-9`~!"@№%#\$;:\?\/\\&\*\+-_\(\)=\{\}\[\]\'|\<\>\s]*$/i','message' => Yii::t("main","34_only_latin_characters_allowed_for"),'on'=>'suggest'), 
			 array('message', 'length', 'min'=>0, 'allowEmpty'=>false, 'max'=>500, 'tooShort'=>Yii::t("main","528_min_length_is"), 'tooLong'=>Yii::t("main","529_max_length_is"),'on'=>'suggest'),
		);
	}
	
	public function attributeLabels()
	{
		if($this->getScenario()=='suggest'){
			return array(
				'message'=>Yii::t("sp","192_message")
			);
		}
	}
}