Download the PHP package cube-group/lvalidator without Composer

On this page you can find all versions of the php package cube-group/lvalidator. 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 lvalidator

LValidator是一个简单的验证类

支持批量验证表单数据、自定义错误信息,简化大量的验证判断代码,使代码变得加简洁优雅!

快速使用

输出

快速验证单个规则

使用demo1 通过rule或rules添加验证规则

构造函数传入验证数据

输出

使用demo2 自定义错误信息

设置规则的的message属性 {field}最终替换为字段键, {value}替换为字段值

输出

使用demo3 设置字段标签

设置提示字段标签, 如name显示为名字, 通过构造方法传字段标签数组

输出

以下是目前支持的验证规则

验证规则使用Demo

required(验证必传)

设置skipEmpty属性为1可以跳过空验证,但是字段必传

json(验证json格式)

url(验证URL地址)

ip(验证IP地址)

email(验证邮箱)

numeric(验证数字)

alpha(验证英文字母)

alphaNum(验证英文字母+数字)

slug(英文字母+数字+破折号+下划线)

bool(验证必须是布尔值)

date(验证必须是时间日期格式)

tel(验证大陆电话)

mobile(验证手机号)

same(验证字段必须和另一个字段值相同)

diff(验证字段必须和另一个字段值不同)

compare(对比验证(支持> >= < <= == === != !===)

length(字符串长度对比验证,基于compare验证)

contains(必须包含acb)

in(必须在范围[1,2,3])

notIn(必须不在范围[1,2,3])

regex(正则验证)

func(函数或方法验证)

闭包验证(验证名字必须是helloWorld)

其他方法

设置字段标签

通过lables批量方法追加, 如果已经在值, 将覆盖旧值

调用rule后通过label方法添加


All versions of lvalidator with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
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 cube-group/lvalidator contains the following files

Loading the files please wait ....