开发者

How can I add custom path for validators?

开发者 https://www.devze.com 2023-01-20 13:18 出处:网络
Zend Framework defaultly lo开发者_C百科oks for validators only in this path: Zend_Validate_: Zend/Validate/

Zend Framework defaultly lo开发者_C百科oks for validators only in this path:

Zend_Validate_: Zend/Validate/

How can I make it look also in, for example:

My_Validator_: My/Validator/

I can't find anything about this problem in the documentation.


Should be

$element->addPrefixPath('My_Validator_', 'My/Validator', 'VALIDATE');

To do it at the form level, it should be:

$form->addElementPrefixPath('My_Validator_', 'My/Validator', 'VALIDATE');
0

精彩评论

暂无评论...
验证码 换一张
取 消