azly/kphp_validator
最新稳定版本:v0.0.1
Composer 安装命令:
composer require azly/kphp_validator
包简介
KPHP Validator
README 文档
README
KPHP Validator
Implemented functions
You can use following constraints for validate data if you want compile your project with KPHP:
Length($min ::: int = -1, $max ::: int = -1, $exact ::: int = -1); Type($type ::: string); NotBlank(); Email();
Installation
To install this library, follow these steps:
git clone https://github.com/VKCOM/kphp
composer require azly/kphp_validator:dev-master
Quick start
-
Create vendor/autoload.php with composer
-
Create index.php and write here:
<?php require_once __DIR__ . '/vendor/autoload.php'; // Create a list with constraints $ConstraintListFactory = new ConstraintListFactory(); // Create a validator $validatorFactory = new ValidatorFactory(); // Example of create a constarints $constraintList->addConstraint("name", new Type("string")); $constraintList->addConstraint("email", new Email()); // Validation $validator->validate($form, $constraintList);
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-18