Page 1 of 1

Zend_Form validator question

Posted: Thu May 22, 2008 6:53 am
by georgeoc
Hi.

I'm configuring a Zend_Form object from an ini file. One element has this configuration:

Code: Select all

; userEmail element
elements.userEmail.type = "text"
elements.userEmail.options.label = "Email address"
elements.userEmail.options.required = "true"
elements.userEmail.options.validators.emailaddress.options = "EmailAddress"
 
I can't work out how to control some of the flags available to the Email Address validator, such as Zend_Validate_Hostname::ALLOW_DNS, Zend_Validate_Hostname::ALLOW_LOCAL and the methods like setValidateIdn() on the Zend_Validate_Hostname class.

Is it possible to control all these using my ini file?

Re: Zend_Form validator question

Posted: Thu May 22, 2008 6:59 am
by georgeoc
I've found I can use:

Code: Select all

elements.userEmail.options.validators.emailaddress.options.allow = 7
...where 7 is the current value of Zend_Validate_Hostname::ALLOW_ALL. This has the result I'm looking for.

However, it is a nasty hack. Is there a way to specify this correctly in the config file?