2017 © Pedro Peláez
 

yii2-extension yii2-phone-validator

Yii2 phone validator

image

miserenkov/yii2-phone-validator

Yii2 phone validator

  • Friday, March 17, 2017
  • by miserenkov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,396 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 26 % Grown

The README.md

Yii2 Phone Validator

Yii2 validator for phone numbers, (*1)

License Latest Stable Version Latest Unstable Version Total Downloads Build Status, (*2)

Support

GitHub issues., (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

php composer.phar require --prefer-dist miserenkov/yii2-phone-validator "^1.0"

or add, (*6)

"miserenkov/yii2-phone-validator": "^1.0"

to the require section of your composer.json file., (*7)

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()],
        // ...
    ];
}

The Versions

17/03 2017

dev-master

9999999-dev

Yii2 phone validator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Misha Serenkov

yii2 validator phone

17/03 2017

v1.1

1.1.0.0

Yii2 phone validator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Misha Serenkov

yii2 validator phone

05/03 2017

v1.0

1.0.0.0

Yii2 phone validator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Misha Serenkov

yii2 validator phone