yii2mod/yii2-validators
最新稳定版本:1.2
Composer 安装命令:
composer require yii2mod/yii2-validators
包简介
Collection of useful validators for Yii Framework 2.0
README 文档
README
Collection of useful validators for Yii Framework 2.0
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yii2mod/yii2-validators "*"
or add
"yii2mod/yii2-validators": "*"
to the require section of your composer.json file.
Usage
- Credit Card Validator
public function rules() { return [ [['creditCard'], \yii2mod\validators\ECCValidator::className()], ]; }
- Yii2 phone validator is a validator uses phone number util to validate and format the phone number attribute of model.
public function rules() { return [ [['phone'], \yii2mod\validators\PhoneValidator::className(), 'country' => 'US'], // OR [['phone'], \yii2mod\validators\PhoneValidator::className(), 'countryAttribute' => 'country'], // OR [['phone'], \yii2mod\validators\PhoneValidator::className(), 'countryCodeAttribute' => 'countryCode'], ]; }
统计信息
- 总下载量: 16.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 18
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-11-26