wdmg/yii2-validators
最新稳定版本:1.1.0
Composer 安装命令:
composer require wdmg/yii2-validators
包简介
Custom validators for Yii 2.0
README 文档
README
Yii2 Validators
Custom validators for Yii2
Requirements
- PHP 5.6 or higher
- Yii2 v.2.0.40 and newest
Installation
To install the validators, run the following command in the console:
$ composer require "wdmg/yii2-validators"
Usage
Example of usecase StopListValidator to model rules:
<?php
use wdmg\validators\StopListValidator;
...
public function rules() {
return [
[['attribute'], StopListValidator::class, 'stoplist' => ['admin', 'root', 'superuser', ...], 'message' => 'You can not use this value `{value}` for field `{attribute}`'],
...
];
}
?>
Status and version [in progress development]
- v.1.1.0 - Update copyrights
- v.1.0.7 - StopListValidator renamed to ReservedValidator
- v.1.0.6 - Update README.md and dependencies
统计信息
- 总下载量: 1.26k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 13
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-27