Is It Possible To Display Only The Default Error Message?

Hello, I want to know if it is possible to display only one message for all errors.

My code looks something like this:


public function rules()

	{

		return array(

			array('image', 'file', 'types'=>'jpg, jpeg, png', 'maxSize'=>(1024 * 8000), 'safe'=>true, 'on'=>'uploadPhoto',

				'message'=>'Image must be .jpg or .png, 8MB and bigger than 300x300 pxels!',

				'wrongType'=>'error for type',

				'tooLarge'=>'error for tooLarge',

			),

			array('image', 'EPhotoValidator', 'minWidth'=>300, 'minHeight'=>300, 'safe'=>true, 'skipOnError'=>true, 'on'=>'uploadPhoto', 

				'minWidthError'=>'error for width!', 

				'minHeightError'=>'error for height'

			),

		);

	}

As you can see I had to write errors for all the cases. I will like to display only one message for all errors, something like the default message: "Image must be .jpg or .png, 8MB and bigger than 300x300 pxels!". Is it possible?

Hi

You can use this like




public function rules() {

        $message ="". Yii::t('app','{attribute} cannot be blank.')."";


        return array(

          array('firstname, lastname, email, username, password, restaurant_name, created_at, is_active', 'required','message'=>$message),

       );

}

Thake you Ankit Modi :D