miserenkov/yii2-phone-validator
最新稳定版本:v1.2
Composer 安装命令:
composer require miserenkov/yii2-phone-validator
包简介
Yii2 phone validator
关键字:
README 文档
README
Yii2 validator for phone numbers
Support
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist miserenkov/yii2-phone-validator "^1.0"
or add
"miserenkov/yii2-phone-validator": "^1.0"
to the require section of your composer.json file.
Basic usages
With fixed country value
public function rules() { return [ // ... ['phone', \miserenkov\validators\PhoneValidator::className(), 'country' => 'UA'], // ... ]; }
With fixed country attribute
public function rules() { return [ // ... ['country', 'string'], ['phone', \miserenkov\validators\PhoneValidator::className(), 'countryAttribute' => 'country'], // ... ]; }
With fixed countries value
public function rules() { return [ // ... ['phone', \miserenkov\validators\PhoneValidator::className(), 'countries' => ['UA', 'RU', 'US', /*...*/]], // ... ]; }
With all countries
public function rules() { return [ // ... ['phone', \miserenkov\validators\PhoneValidator::className()], // ... ]; }
统计信息
- 总下载量: 23.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-03-05