Jump to content
Larry Ullman's Book Forums

Property "Cemailvalidator.0" Is Not Defined


Jonathon
 Share

Recommended Posts

Hi Larry,

 

I'vw just been working through the rules you create and just having a play with Yii. Whilst I was looking at file/create I had a look at user/create too. Page through this error.

 

exception 'CException' with message 'Property "CEmailValidator.0" is not defined.' in C:\xampp\yii-1-1-12\framework\base\CComponent.php:174

 

I could send the whole stack trace but didn't want to, I wasn't sure if this was expected behaviour at this point as we're working through or if it was a sign of an error in my work.

 

Jonathon

Link to comment
Share on other sites

Why don't you just show us the rules() method code for the User model, then it might be possible to work out what is going on?

 

An email validator can be declared like this using the email alias keyword.

 

array('email', 'email', 'checkMX'=>true, 'message'=>'Please enter a valid email!'),

 

checkMX Checks to see if this is a valid email domain.

Link to comment
Share on other sites

Hi Larry,

 

At the time I did check my code against yours, and couldn't see any errors. Then I just copied yours across and it worked fine and noted i'd put single quotes around some of the rules when I should have just separated them with a comma. I've since shaved and shut down my PC so I couldn't tell you my original code (sorry). Just tried to recreate it, couldn't achieve this though.

 

 

Jonathon

Link to comment
Share on other sites

 Share

×
×
  • Create New...