Download the PHP package youloge/webman.validate without Composer

On this page you can find all versions of the php package youloge/webman.validate. 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 webman.validate

Youloge.validate Webman 高级表单验证器(PHP7.2+)

Brightgreen Packagist Languages Packagist Downloads License

Webman 表单验证器是:Github Youloge.Tool 的子函数之一,如果安装了webman.tool就不需要再安装webman.validate了。经过webman.validate 过滤处理后的表单,基本可以达到入库要求,可以大大简化逻辑处理。[2.0.0+ 版本进行了重写 现在处理可以处理更加复杂的表单且不需要进行多次验证,在一个验证规则中即可处理任意复杂度的数据]

项目地址

Youloge.Validate Star 我 如果对你的项目有帮助 欢迎打赏~

安装使用

composer require youloge/webman.validate

函数名称 useValidate()

使用说明

验证规则: |,:,,,#,[]

参数说明

验证规则 说明 示例 规则类型
required 字段必填 required 基本处理
int 转为 int 类型 int:10 基本处理
bool 转为 bool 类型 bool:false 基本处理
float 转为 float 类型 float:1.2 基本处理
string 转为 string 类型 int:string 基本处理
array 转为 array 类型 array:[] 基本处理
object 转为 object 类型 object:{} 基本处理
upper 转为 大写字母 upper 基本处理
lower 转为 小写字母 lower 基本处理
sprintf 格式化字符串 sprintf:%.2f 基本处理
format 格式化字符串 sprintf:%.4f 基本处理
join 数组转字符串:可以指定连接符号,默认逗号 join:@ 基本处理
trim 去除参数两端空白符 trim 基本处理
xss 过滤特殊符号:支持不过滤(标签) xss: 基本处理
html 转义 HTML 标签 html 基本处理
--- --- --- ---
email 验证是否为邮箱 email 常用验证
mobile 验证是否手机号(国内) mobile 常用验证
url 验证是否 URL 协议网址 url 常用验证
ip 验证是否 IP 地址 ip 常用验证
date 验证日期 date:Y-m-D H:i:s 常用验证
idcard 验证是否身份证(国内) idcard 常用验证
regex 正则验证 regex:[a-zA-Z]{16} 常用验证
test 正则验证 regex:[a-zA-Z]{16} 常用验证
--- --- --- ---
min 参数最小值 min:1 数字相关
max 参数最大值 max:20 数字相关
between 参数取值范围 between:1,100 数字相关
--- --- --- ---
start 参数必须以%开头 start:@ 字符相关
end 参数必须以%结尾 end:@qq.com 字符相关
digit 参数必须为纯数字 digit 字符相关
alpha 参数必须为纯字母 alpha 字符相关
alphanum 参数必须为数字和数字 alphanum 字符相关
length 参数字符长度要在 min ~ max 之间 length:12,14 字符相关
len 参数字符长度要在 min ~ max 之间 length:12,14 字符相关
--- --- --- ---
in 参数取值在之内 between:a,b,c 取值相关
not 参数取值在之外 between:x,y,z 取值相关
count 数组个数要在 min ~ max 之间 count:1,6 取值相关

xss 过滤不仅会过滤 html 标签,还会过滤 ',",;,--,%,_,(,), 可以防止Mysql 注入



简单示例:

复杂示例:

请求数据:

验证规则:

流式处理

之前想对一个字段进行复杂操作,需要写第一步,第二步,第三步...,现在直接可以写成一维数组形式,规则:['int:100'] 数组只有一个规则代表:数组按照改规则处理,当规则不止一个按照自动展开规则,再按照从左到右依次验证处理。


规则的配置是和输入表单 是对应的关系,验证器会预处理数据并交给后续过滤规则,所以碰到需要处理同一个键同时进行修改+验证的情况,进行多次拆分即可。


wallet.micateam


All versions of webman.validate with dependencies

PHP Build Version
Package Version
No informations.
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 youloge/webman.validate contains the following files

Loading the files please wait ...