Jonathon Posted November 29, 2012 Share Posted November 29, 2012 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 More sharing options...
Edward Posted November 30, 2012 Share Posted November 30, 2012 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 More sharing options...
Jonathon Posted November 30, 2012 Author Share Posted November 30, 2012 It was just the model rules for user() that Larry had in the book. I'd quoted each required field, when i shouldn't have. // Required fields array('username, email, pass', 'required'), Link to comment Share on other sites More sharing options...
Larry Posted November 30, 2012 Share Posted November 30, 2012 That line is not causing the problem. What are the rules specific to email? Link to comment Share on other sites More sharing options...
Jonathon Posted December 1, 2012 Author Share Posted December 1, 2012 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 More sharing options...
Recommended Posts