yii2 框架定义的约束
'yii\validators\BooleanValidator','captcha' => 'yii\captcha\CaptchaValidator','compare' => 'yii\validators\CompareValidator','date' => 'yii\validators\DateValidator','default' => 'yii\validators\DefaultValueValidator','double' => 'yii\validators\NumberValidator','each' => 'yii\validators\EachValidator','email' => 'yii\validators\EmailValidator','exist' => 'yii\validators\ExistValidator','file' => 'yii\validators\FileValidator','filter' => 'yii\validators\FilterValidator','image' => 'yii\validators\ImageValidator','in' => 'yii\validators\RangeValidator','integer' => ['class' => 'yii\validators\NumberValidator','integerOnly' => true],'match' => 'yii\validators\RegularExpressionValidator','number' => 'yii\validators\NumberValidator','required' => 'yii\validators\requiredValidator','safe' => 'yii\validators\SafeValidator','string' => 'yii\validators\StringValidator','trim' => ['class' => 'yii\validators\FilterValidator','filter' => 'trim','skipOnArray' => true],'unique' => 'yii\validators\UniqueValidator','url' => 'yii\validators\UrlValidator']
以上所述是小编给大家介绍的Yii2 rules 的验证规则。编程之家 jb51.cc 收集整理的教程希望能对你有所帮助,如果觉得编程之家不错,可分享给好友!感谢支持。
原文链接:https://www.f2er.com/php/18357.html