How Use Except At Model Rules?

Model code




public function rules()

	{

		return array(

			array('language', 'required'),

                        array('startdate, enddate', 'dateCompare', 'except'=>'Scenario1'), //Scenario1 is Scenario name

		);

	}

public function dateCompare($attribute, $params){

		if(!empty($this->startdate) && !empty($this->enddate)){

			if(strtotime($this->enddate) < strtotime($this->startdate)){

				$this->addError($attribute, Yii::t("global", "End date should bigger than starting date"));

			}

		}

	}



‘except’ not work

My Yii framework version: 1.1.11-DEV

Check the documentation - http://www.yiiframework.com/doc/api/1.1/CValidator#except-detail

It say that except should be an array.

Thanks for your reply, I got it. It should be Yii framework 1.1.11-DEV matter, and that works when I try framework 1.1.13.