revenuewire/validator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

revenuewire/validator

最新稳定版本:v1.1.14

Composer 安装命令:

composer require revenuewire/validator

包简介

RW Helpers

README 文档

README

Build Status Coverage Status Latest Stable Version License composer.lock

Quick Start

Install

composer require revenuewire/validator

Usages

Simple Example

//example of testing my age
$validator = new \RW\Validator();
$result = $validator->validateAge(20, "myAge", ["min" => 18, "max" => 99]);
var_dump($result); //true

//same validator, but using birthday
$validator = new \RW\Validator();
$result = $validator->validateAge("1987-01-08", "myAge", ["min" => 18, "max" => 99]);
var_dump($result); //true

$validator = new \RW\Validator();
$result = $validator->validateAge(16, "myAge", ["min" => 18, "max" => 99]);
var_dump($result); //false

/**
*  [
*     "key" => "myAge",
*     "error" => "myAge must be greater than 18.",
*     "contexts" => [
*        "min" => 18, "max" => 99
*     ]
*  ]
*/
var_dump($validator->getValidateResult());

Options

Options Comments
max If it is string validation, use strlen().
min If it is string validation, use strlen().
allowedValues An array of items allowed for a given data
validExceptions An array of characters that always consider valid regardless the type check. For examples, if the validException is set to be ["_", "-"], and combine with alnum, you will have validate against alpha-numeric with exception of underscore and dash
alnum Only alpha-numeric are valid.
alpha Only alphabets are valid.
upper Only upper case alphabets are valid.
lower Only lower case alphabets are valid.
dateFormat check the date format to match
countryFormat [ alpha2, alpha3, numeric ] check the country data with alpha2 (default for country validation)

统计信息

  • 总下载量: 1.63k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 7
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2018-10-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固