-- Greg Frith <[EMAIL PROTECTED]> wrote
(on Thursday, 14 February 2008, 12:24 PM +0000):
> I'm trying to use my XML config file to add custom validator paths to every
> element in a Zend_Form instance.
>
> Here is an extract from my configuration file (this is the config tree I pass
> to new Zend_Form):
>
> <name>userRegister</name>
> <action>/authentication/register/</action>
> <method>post</method>
> <elementPrefixPaths>
The above should be singular (even though it allows for multiple
entries): 'elementPrefixPath'. That should solve your issue, including
the exception from attempting to load the custom validator class.
> <validate>
> <prefix>WETB_Validate</prefix>
> <path>WETB/Validate</path>
> <type>validate</type>
> </validate>
> </elementPrefixPaths>
> <elements>
> <title>
> <type>select</type>
> .....
>
> Here is a snippet of the function I am then using to test:
>
> function registerAction() {
> $form = new Zend_Form($this->config->forms->userRegistration);
> $fn = $form->getElement('firstname');
> $p = $fn->getPluginLoader('validate');
> print_r($p->getPaths());
> .....
>
> The print_r statement outputs:
>
> Array ( [Zend_Validate_] => Array ( [0] => Zend/Validate/ ) )
>
> I would expect this array to also contain the custom path.
>
> In addition, the plugin loader throws an exception if I try to use a custom
> validator class.
>
> Any ideas?
>
> :wq
> Greg.
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/