views:

39

answers:

1

Hello!

I'm having problem with custom builded validator that does not returns any error. I copied a file NotEmpty.php form folder library/Zend/Validate, rename class Zend_Validate_NotEmpty to My_Validate_EmailConfirmation and put it into folder My/Validate.

If I call this class like ->setRequired(true)->addValidator('NotEmpty',true,array('messages' => array('isEmpty' => "bla"))); I get the correct error, but if i call it like ->setRequired(true)->addValidator('EmailConfirmation',true,array('mess ages' => array('isEmpty' => "bla")))->addPrefixPath('My_Validate','My/Validate/','validate'); i get nothing...

What am i doing wrong? Thanks is advanced for your answers...

A: 

Have you tried to set in your bootstrap file your new namespace?

Zend_Loader_Autoloader::getInstance()->registerNamespace('My');

Also, why not you just extends the NotEmpty validator instead of duplicate the class?

Keyne