Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Not an Issue
-
Affects Version/s: None
-
Fix Version/s: 1.8.1
-
Component/s: Zend_Validate
-
Labels:None
Description
When validating register form, two validations are always needed:
1) Check user name availability
2) Check password and re enter password(or emails) matching
Christer has done 2) in his blog:
http://cogo.wordpress.com/2008/04/16/custom-validators-for-zend_form_element/
I have done 1) in my project as a custom validator.
But I think it is nice that these two validators could be ship with ZF as standard validator.
To implement 1) you would need to have some sort of interface that the end users of ZF would have to implement though. It's impossible to make a generic validator for that since pretty much everyone has their own setup regarding user accounts.
I have implemented something like that but the class I have written will only work for my setup. If you could make a generic validator along with a small interface with a single method:
public function isTaken($userName);
or something like that, I guess it could be more simple to use. But 2) would be great to have in ZF I think.