edofre/yii2-validators

Yii2 frequently used validators

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Type:yii2-extension

V1.0.2 2016-12-25 11:12 UTC

This package is not auto-updated.

Last update: 2024-12-21 20:41:29 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock

Installation

The preferred way to install this extension is through composer.

To install, either run

$ php composer.phar require edofre/yii2-validators "V1.0.2"

or add

"edofre/yii2-validators": "V1.0.2"

to the require section of your composer.json file.

ZipCodeValidator

Insert into rules as following

/**
* @inheritdoc
*/
public function rules()
{
    return [
        ...
        ['zip_code', 'edofre\validators\ZipCodeValidator'],
        ...
    ];
}

PriceValidator

Insert into rules as following

/**
* @inheritdoc
*/
public function rules()
{
    return [
        ...
        ['price', 'edofre\validators\PriceValidator'],
        ...
    ];
}