Zend Framework 2 - Custom Form Validation

◇◆丶佛笑我妖孽 提交于 2019-12-02 03:45:58

I will be assuming for a directory structure now.

Vendor name: MyStuff

FQCN: MyStuff\Validator\AwesomeValidator;

FilePath: ./vendor/mystuff/library/MyStuff/Validator/AwesomeValidator

Given that Zend Framework 2 follows the PSR-0 Standard for Autoloading, you will need to add the autoloader path to your vendor autoloaders. ZF2 uses Composer to handle the autoloading. When you install your OWN Vendor via Composer, this is done automatically. If you need to to this manually, you do it inside composer.json

"autoload": {
    "psr-0": {
        "Mystuff\\": "vendor/mystuff/library/"
    }
}

I hope this will give you enough to work with.

An alternative to using composer is a more manual approach which might avoid your include issue. The comments on this page may be helpful to show you where to put things manually: http://framework.zend.com/manual/2.0/en/modules/zend.validator.writing-validators.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!