Hi all,
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>
<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.