Performing authentication in custom validator in ZF

Although, this is not a good approach to use more than one value in Zend_Validate, but it may be useful sometimes if you want to write your custom validator and add it to let’s say password field and use it as other validators in Zend_Form. So

we added it to password field. Now let’s have a look at its implementation:

We assume that username and password columns are in users table (see Pay attention to this


context = null second parameter. It holds all form values. So there we get username field.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.