3

I put the class under
application\validate\PasswordConfirmation.php

And it doesn't work.

Error
Class 'Default_Validate_PasswordConfirmation' not found

still occurs.

Does anyone have this problem before?

3 Answers 3

1

For customer validators, you need to put them in a location that is on your include path. Also, you need to add your validator to make it available using Zend_Validate::addValidator().

See the documentation for more information.

1
1

I usually place them at /library/CV/Validate/

Example:

/library/CV/Validate/EmpresaNueva.php:
class CV_Validate_EmpresaNueva extends Zend_Validate_Abstract {
    //Validator code
}

Where library is the place where you have Zend.

Content of index.php @ /public:

$root = dirname(dirname(__FILE__));

set_include_path($root.'/application' . PATH_SEPARATOR
    .$root.'/library' . PATH_SEPARATOR
    . get_include_path()
);
3
  • I try to place the file under library/My/Validate/PasswordConfirmation.php. But the Class "'Default_Validate_PasswordConfirmation' not found" still occurs. Do I miss any steps?
    – Billy
    Jun 19, 2009 at 2:33
  • I try to place the file under library/Default/Validate/PasswordConfirmation.php
    – Billy
    Jun 19, 2009 at 2:34
  • Check the edit. library/ es where Zend folder is placed. Don't know where you have yours.
    – Macarse
    Jun 19, 2009 at 8:20
1

Let me answer my own question:

I add the validator successfully according to this post: Where should My_Validate_PasswordConfirmation put in Zend framework?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.