Download the PHP package xu767142206/x-validated without Composer
On this page you can find all versions of the php package xu767142206/x-validated. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download xu767142206/x-validated
More information about xu767142206/x-validated
Files in xu767142206/x-validated
Download xu767142206/x-validated
More information about xu767142206/x-validated
Files in xu767142206/x-validated
Vendor xu767142206
Package x-validated
Short Description Request Data Validated For Hyperf
License MIT
Package x-validated
Short Description Request Data Validated For Hyperf
License MIT
Please rate this library. Is it a good library?
Informations about the package x-validated
x-validated
简易版注解验证库 for Hyperf, 基于 hyperf/validation
起因:一直眼馋springboot的validation库,正好php8也有了原生的注解,就想到了套娃的方式简易实现 后面有闲情了再想办法自己实现吧
安装
~~~shell script composer require xu767142206/x-validated
## 配置
1.config/autoload/exceptions.php 也可以自己实现ValidationException的处理
## 使用
dto模型的定义
> dto模型必须继承 XValidated\ValidatedData
模型的定义
> rule规则可以查看 hyperf/validation库的验证规则 [验证规则](https://hyperf.wiki/3.0/#/zh-cn/validation?id=%e9%aa%8c%e8%af%81%e8%a7%84%e5%88%99)
然后创建控制器 `IndexController`:
接着可以快乐的写代码了
## License
MIT
All versions of x-validated with dependencies
PHP Build Version
Package Version
The package xu767142206/x-validated contains the following files
Loading the files please wait ....