sadi01 / yii2-iran-national-code-validator
Validates that the attribute value is a valid Iran national code.
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-11-24 17:41:58 UTC
README
NationalCodeValidator validates that the attribute value is a valid Iran national code.
Installation
The preferred way to install this extension is through composer.
Either run console command
composer require sadi01/yii2-iran-national-code-validator "*"
Or add the package to the require
section of your composer.json
file:
{ "require": { "sadi01/yii2-iran-national-code-validator": "*" } }
then run composer update
.
Usage
Once the validator is installed, simply use it in your model's rules :
public function rules() { return [ ['national_code', NationalCodeValidator::class], ]; }