vakata/validation
最新稳定版本:1.9.10
Composer 安装命令:
composer require vakata/validation
包简介
A validation class
README 文档
README
An extended implementation of the routing class, dealing with an HTTP abstraction and middleware.
Install
Via Composer
$ composer require vakata/validation
Usage
$v = new \vakata\validation\Validator(); $v ->required('name', 'requiredN')->alpha(null, "alphaN")->notEmpty("empty") ->required('family', 'requiredF')->alpha(null, "alphaF") ->required('age', 'requiredA')->numeric("numericA") ->optional("newsletter")->numeric("numericN") ->optional("children.*.name")->alpha(null, "alphaC") ->optional("children.*.age")->numeric(null, "numericC"); $errors = $v->run($_POST); // inspect the array - if empty - the data is valid
Read more in the API docs
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email github@vakata.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 5.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-20