Skip to content

reaway/think-validate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

think-validate

安装

composer require reaway/think-validate

用法

use Think\Component\Validate\Facade\Validate;

require __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

$rule = [
    'name'  => 'require|max:25',
    'email' => 'email'
];
$data = [
    'name'  => 'thinkphp',
    'email' => '[email protected]'
];
$validate = Validate::rule($rule);
if (!$validate->check($data)) {
    var_dump($validate->getError());
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages