Use for anyone who is a little confused is to take the last part of any Zend_Validate_XYZ and use XYZ as a string in any addValidator chain, for example: → addValidator ('XYZ'), so for example, to check the email address use the Zend_Validate_EmailAddress class or → addValidator ('EmailAddress') in item variable
Do not forget that the second parameter is whether the failure should interrupt the chain. True breaks the chain, False - no. So, if we want to check only the Alpha field, then the AlphaNumeric field, but NOT break if the Alpha field! IsValid (), then: -> addValidator ('Alpha', FALSE) -> addValidator ('AlNum', TRUE)
Chukky nze
source share