Download the PHP package verdient/validator without Composer

On this page you can find all versions of the php package verdient/validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package validator

校验器

批量校验数据

校验单个数据

获取错误信息

获取第一个错误

直接取得错误提示信息

校验器及其参数

名称 简述 参数 [默认值] 释义
required 校验是否为空
string 校验是否为字符串 min [false] 最小长度
max [false] 最大长度
length [false] 长度,当length和min或者max同时设置时,已length的设置为准
charset [false] 字符集
tooShort 长度过短时的提示信息
tooLong 长度过长时的提示信息
wrongLength 长度不匹配时的提示信息
wrongCharset 字符集不匹配时的提示信息
mobile 校验是否为合法的手机号码
in 校验是否在给定的范围内 range 范围
strict [false] 是否严格匹配
date 校验是否为日期 format [Y-m-d] 格式
min [false] 最小日期
max [false] 最大日期
tooSmall 日期过小提示信息
tooBig 日期过大提示信息
number | integer | int 校验是否为数字 | 整数 min [false] 最小
max [false] 最大
tooSmall 数字过小提示信息
tooBig 数字过大提示信息
decimal 校验是否小数 min [false] 最小
max [false] 最大
tooSmall 数字过小提示信息
tooBig 数字过大提示信息
decimal 做多允许的小数点位数
wrongDecimal 当小数点错误时的提示
email 校验是否为电子邮件地址 checkDNS [false] 是否检查DNS
ip 校验是否为IP地址 ipv4 [true] 是否允许IPv4地址
ipv6 [true] 是否允许IPv6地址
subnet [false] 子网信息 - false 不允许携带子网 | true 必须包含子网信息 | null 子网信息可选
negation [false] 是否允许包含取反标志位
ipv4NotAllowed IPv4不被允许时的提示信息
ipv6NotAllowed IPv6不被允许时的提示信息
noSubnet 不包含子网信息时的提示信息
hasSubnet 包含子网信息时的提示信息
url 校验是否为url地址 schemes [http, https] 允许的协议
chineseIDCard 校验是否为中国身份证号码 enable15 [true] 是否允许15位身份证号码(第一代身份证)
uuid 校验是否为UUID version [*] 特定的版本,*代表所有版本
array 校验是否为数组 indexded[false] 是否仅索引数组
distinct 是否不允许重复值[false]
min 数组中元素数量下限[false]
max 数组中元素数量上限[false]
noIndexd 数组不为索引数组时的提示
hasDuplicate 数组中存在重复值时的提示
tooSmall 数组过小时的提示
tooBig 数组过大时的提示
bool 校验是否为布尔值
money 校验是否为金额 参数同decimal
snowflake 校验是否为Snowflake ID
pagination 校验是否为页码及分页大小 参数同integer
safe 安全校验器,该校验器不会对数据做任何校验,用于从data()函数直接获取传入的数据

公共参数

名称 简述 参数 [默认值] 释义
skipOnEmpty 是否在为空时跳过 bool[true]
allowArray 是否允许数组 bool[true] 当该值为true时,相当于循环调用校验器(除array校验器)
message 校验错误时的提示信息 {name}校验失败 {name}会被替换为属性名称
isArray 传入数据为数组时的提示信息 {name}不能为数组(对象) 仅在allowArray为false时生效
when 限定条件 array[null] 只有符合限定条件是时,校验器才会执行
name 显示的名称 string[null] 用于覆盖错误信息中字段的名称
## 限定条件 可以在声明限定条件时指定when参数来限定校验器的执行,只有当限定条件满足时,校验器才会真正的被执行,否则将会跳过校验器的检查。 参数的格式为: name代指属性名称,operator为操作符,comparedValue为被比较的值 其中name和value必填,comparedValue默认为空

All versions of validator with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
verdient/chorus Version ~0.1.0
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command

The package verdient/validator contains the following files

Loading the files please wait ....

© 2017 - 2024 Weber Informatics LLC