Normally in Yii model rules validation to set the error message like below:
array('username', 'required', 'message'=>'username cannot blank.');
But, numerical validate method is different if you set the ‘min‘ or ‘max‘ inside the rules.
array('username', 'required', 'message'=>'username cannot blank.');