validator error

I can’t figure out where I’ve gone wrong. I am getting the following error:

Licensee has an invalid validation rule. The rule must specify attributes to be validated and the validator name.

My LicenseeForm model has the following code that is being executed:




class LicenseeForm extends CFormModel

{

	public $email;

	public $password;

	public $url;

	public $verifyCode;


	public function rules()

	{

		return array(

			array('email, password, url', 'required'),

			array('email', 'email'),

			array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()),

		);

	}


	public function addLicensee()

	{

		

		$licensee=new Licensee;

		$licensee->url = $this->url;

		$licensee->email = $this->email;

		$licensee->password = $this->password;

		$licensee->status = 0;

		$licensee->background = 'ffffff';

		$licensee->width = '950';

		$licensee->searchFont = '000000';

		$licensee->topicFont = 'ffffff';

		$licensee->topicBackground = '4c99c5';

		$licensee->topicBorder = '13487c';

		$licensee->signupDate = date('Y-m-d H:i:s');

		$licensee->save();

		

	}



My understanding is that when you call the save() function the validation rules are triggered. The rules I’ve set up are fairly standard - check for empty values, email validation, and a captcha. Why am I receiving this error?

Rules seems OK to me… you can try to remove them one by one to see what is the problem…

Ops… as soon as I wrote the previous post I realized one thing…

You posted here the rules of LicenseeForm but you are saving a model of type Licensee… so you need to check the rules in the Licensee module…

Ah - ok, I was looking at the wrong model. Found the bug pretty quick after looking in the right place - thanks!