PHP code example of yiibr / yii2-br-validator

1. Go to this page and download the library: Download yiibr/yii2-br-validator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yiibr / yii2-br-validator example snippets



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