I am using the password confirmation validator from the official Zend framwork document here:
http://framework.zend.com/manual/en/zend.form.elements.html
In Bootstrap.php, I have set the namespace as
'namespace' => 'My_'
The file is located at application/validate/PasswordConfirmation.php
However, "Fatal error: Class 'My_Validate_PasswordConfirmation' not found" occurs in my Zend_Form.
What should I do to fix the problem?
I designed and implemented
Zend_Filter_Input
, including its namespace feature.You have a backwards understanding of how this feature works. It's meant to allow you to use a short name for a validator class when the actual name of that class is longer. You're apparently doing the reverse, trying to name a class with a longer name than it actually has.
To fix this I recommend the following steps:
My_Validate_PasswordConfirmation
namespace=>'My_Validate'
to yourZend_Filter_Input
options.update: I spent some time on this. It seems my first idea was off target. The namespace issue you have has nothing to do with the feature of
Zend_Filter_Input
, it has to do with theZend_Application
bootstrap feature. It seems that you can specify a class prefix to the autoloader.Here's another clue:
So try this:
with no trailing underscore.