Yii2 Israeli ID Validator
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.
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()],
...
];
}
}