yiibr/yii2-br-validator
最新稳定版本:1.1.1
Composer 安装命令:
composer require yiibr/yii2-br-validator
包简介
Provide validations and features for brazilian localization
README 文档
README
Yii2 Extension that provide validators and features for brazilian localization
- CPF: Cadastro de pessoa física (like a Security Social Numeber in USA)
- CNPJ: Cadastro nacional de pessoa jurídica
- CEI: Cadastro específico no INSS (número de matrícula)
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yiibr/yii2-br-validator "*"
or add
"yiibr/yii2-br-validator": "*"
to the require section of your composer.json file.
Usage
Add the rules as the following example
use Yii; use yii\base\Model; use yiibr\brvalidator\CpfValidator; use yiibr\brvalidator\CnpjValidator; use yiibr\brvalidator\CeiValidator; class PersonForm extends Model { public $name; public $cpf; public $cnpj; public $cei; /** * @return array the validation rules. */ public function rules() { return [ // name is required ['name', 'required'], // cpf validator ['cpf', CpfValidator::className()], // cnpj validator ['cnpj', CnpjValidator::className()], // cei validator ['cei', CeiValidator::className()] ]; } }
统计信息
- 总下载量: 100.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 1
- 依赖项目数: 8
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-03-11