PHP code example of rafaelrabaco / yii2-validator

1. Go to this page and download the library: Download rafaelrabaco/yii2-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/ */

    

rafaelrabaco / yii2-validator example snippets



use Yii;
use yii\base\Model;
use rafaelrabaco\validator\CpfValidator;
use rafaelrabaco\validator\CnpjValidator;
use rafaelrabaco\validator\CeiValidator;
use rafaelrabaco\validator\NifValidator;

class PersonForm extends Model
{
	public $name;
	public $cpf;
	public $cnpj;
	public $cei;
	public $nif;

	/**
	 * @return array the validation rules.
	 */
	public function rules()
	{
		return [
			// name is 

php composer.phar