开发者

Zend Framework: How to add a custom validator path to your entire application?

I have custom validators and filters that I have created that I w开发者_高级运维ould like to use throughout my application. All my forms extend a base class. What should I do so that Zend Framework knows where to find these?


Have a look at the Plugin Loaders in the ZF-Documentation

class Your_Form extends Zend_Form
{
    /**
     * @param mixed $options
     * @return void
     */
    public function __construct($options = null)
    {
        $this->addElementPrefixPath('Prefix_Validate', 'Prefix/Validate/');
        $this->addPrefixPath('Prefix_Form', 'Prefix/Form/');

        parent::__construct($options);
    }
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜