ibandominguez/validator
Composer 安装命令:
composer require ibandominguez/validator
包简介
validation class to take care of repetitive tasks
README 文档
README
validator is a helper class for repetitive validation processes.
Getting Started
Clone or Download this package or install via composer
composer require ibandominguez/validator
Available Rules by '20/Jun/15'
| Title | Description |
|---|---|
| required | check if the given input exists and it is not empty |
| check if the given input is a valid email | |
| array | check if the given input is a valid array |
| numeric | check if the given input is a numeric value |
| string | check if the given input is a string value |
| date | check if the given input is a date value with the format (yyyy-mm-dd) |
| datetime | check if the given input is a datetime value with the format (yyyy-mm-dd hh:ii:ss) |
| time | check if the given input is a time value with the format (hh:ii:ss) |
Rules Roadmap
- min
- max
- between
- date format
- alpha
- alpha numeric
Use example
In your application:
<?php require __DIR__.'/vendor/autoload.php'; $inputs = array('name' => '', 'email' => 'johndoe@email.com'); $rules = array('name' => 'required', 'email' => 'required|email'); $v = new IbanDominguez\Validator\Validator($inputs, $rules); $v->passes(); // => false $v->getErrors(); // => array('name' => 'name, rule: required');
License
MIT © Ibán Domínguez
统计信息
- 总下载量: 53
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-06