Zend_Form Check For Existing Email Address In Database
If you’re coding a registration form you will either want to check if a username or an email address is already present in the database. This is very easy to do, assuming you are familiar with using Zend_Form:
That’s all. NOTE: This might be obvious but you cannot chain the setMessage(…) function directly to the end of new Zend_Validate_Db_NoRecordExists(‘user’, ‘email’);
If you are unfamiliar Zend_Form, here’s a full example:
0 评论:
Post a Comment