where can I find a list of all the validators and filters of a Zend_Form?
Asked Answered
M

3

7

I'm learning Zend Framework using their manual at framework.zend.com.

where can I find the full list of all the validators and filters that can be used in a Zend_Form ?

Using Zend Framework 1.11.6.

example:

filters: 'StringTrim' 

validators: 'EmailAddress'

thank you!

Maurita answered 3/6, 2011 at 9:7 Comment(0)
E
11

Check the following paths of your Zend Framework installation folder:

/Zend/Validate/*
/Zend/Filter/*

Or check the corresponding manual pages:

http://framework.zend.com/manual/en/zend.filter.html

http://framework.zend.com/manual/en/zend.validate.html

Episternum answered 3/6, 2011 at 9:11 Comment(1)
thanks a lot! I already checked the urls you provided and still didn't feel like i understand how to use it in Zend_Form. checking the paths location resolved the issue for me!Maurita
S
2

You can use all the shipped filters & validators with zend-form aswell as custom ones.

Sammer answered 3/6, 2011 at 9:12 Comment(0)
H
0

The usage, for anyone that got a little confused as I did, is to take the last part of any Zend_Validate_XYZ and use the XYZ as the string in any addValidator chain like so: ->addValidator('XYZ') so for example, to validate an email address use the Zend_Validate_EmailAddress class or ->addValidator('EmailAddress') on the elements variable

Don't forget that the second parameter is whether a failure should break the chain. True breaks the chain, False does not. So, if we wanted to validate an Alpha only field and then an AlphaNumeric field but NOT break if the Alpha field !isValid() then: ->addValidator('Alpha', FALSE)->addValidator('AlNum', TRUE)

Hiccup answered 26/6, 2013 at 7:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.