2017 © Pedro Peláez
 

yii2-extension yii2-mobile-validator

手机号码验证(中国)

image

chenkby/yii2-mobile-validator

手机号码验证(中国)

  • Thursday, October 12, 2017
  • by chenkby
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 100 % Grown

The README.md

yii2-mobile-validator

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}$/"],
        ...
    }

The Versions

12/10 2017

dev-master

9999999-dev

手机号码验证(中国)

  Sources   Download

BSD-3-Clause

The Requires

 

by Chen GuanQun

yii2 mobile number validate

12/10 2017

v1.0

1.0.0.0

手机号码验证(中国)

  Sources   Download

BSD-3-Clause

The Requires

 

by Chen GuanQun

yii2 mobile number validate