在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):yiibr/yii2-br-validator开源软件地址(OpenSource Url):https://github.com/yiibr/yii2-br-validator开源编程语言(OpenSource Language):PHP 68.3%开源软件介绍(OpenSource Introduction):Yii2 Brazilian ValidatorsYii2 Extension that provide validators and features for brazilian localization
InstallationThe preferred way to install this extension is through composer. Either run
or add
to the require section of your UsageAdd 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()]
];
}
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论