dev-master
9999999-dev手机号码验证(中国)
BSD-3-Clause
The Requires
by Chen GuanQun
yii2 mobile number validate
v1.0
1.0.0.0手机号码验证(中国)
BSD-3-Clause
The Requires
by Chen GuanQun
yii2 mobile number validate
手机号码验证(中国)
Yii2 手机号码验证器, (*1)
添加到你的composer.json文件, (*2)
"chenkby/yii2-mobile-validator": "*"
或, (*3)
composer require "chenkby/yii2-mobile-validator:*"
在model的rule中:, (*4)
public function rules() { ... ['mobile', \chenkby\mobileValidator\MobilePhoneValidator::className()], ... }
注意:本验证器默认使用宽松正则(/^1[1234567890]\d{9}$/), (*5)
$serviceRegex: 服务器端正则表达式, (*6)
$clientRegex: 客户端正则表达式, (*7)
public function rules() { ... ['mobile', \chenkby\mobileValidator\MobilePhoneValidator::className(), 'serverRegex' => "/^1[1234567890]\d{9}$/", 'clientRegex' => "/^1[1234567890]\d{9}$/"], ... }
手机号码验证(中国)
BSD-3-Clause
yii2 mobile number validate
手机号码验证(中国)
BSD-3-Clause
yii2 mobile number validate