mipotech/yii2-israeli-id-validator

Yii2 Israeli ID Validator

1.0.2 2020-10-20 08:58 UTC

This package is auto-updated.

Last update: 2024-05-20 16:10:46 UTC


README

Yii2 Israeli ID Validator

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist mipotech/yii2-israeli-id-validator "*"

or add

"mipotech/yii2-israeli-id-validator": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply add to a model's validation rules as follows:

use mipotech\yii2israelidvalidator\IsraeliIdValidator;

class MyModel extends Model
{
    ...
    public $tz;
    ...
    
    public function rules()
    {
        return [
            ...
            ['tz', IsraeliIdValidator::className()],
            ...
        ];
    }
}