dynamikaweb / yii2-br-validators
Yii2 Brazilian document validator
Package info
github.com/dynamikaweb/yii2-br-validators
Type:yii2-extension
pkg:composer/dynamikaweb/yii2-br-validators
v1.0
2020-08-18 14:18 UTC
Requires
- php: >=5.5.0
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2026-02-19 06:37:19 UTC
README
About
Brazilian document validator
- Titulo de Eleitor: Número do documento eleitoral.
Installation
The preferred way to install this extension is through composer.
Either run
$ composer require dynamikaweb/yii2-br-validators "*"
or add
"dynamikaweb/yii2-br-validators": "*"
to the require section of your composer.json file.
Usage
Add the rules as the following example
use Yii; use yii\base\Model; use dynamikaweb\validators\TituloValidator; class PersonExample extends Model { public $name; public $titulo_eleitor; /** * @return array the validation rules. */ public function rules() { return [ // name is required ['name', 'required'], // Título Eleitoral validator ['titulo_eleitor', TituloValidator::className()] ]; } }