紫悦博客

不进则退,退一步万丈悬崖!

0%

Yii 内置过滤器集合(规则)

参照 http://www.yiiframework.com/doc-2.0/yii-validators-validator.html#$builtInValidators-detail

验证器是所有验证程序的基类。

子类应该覆盖validatevalue()和/或validateattribute()方法提供执行数据验证的实际逻辑。子类也可以覆盖clientvalidateattribute()提供客户端验证支持。
验证器是一套 [[builtInValidators|built-in validators] 可以参考使用短名称。它们被列为如下:

  • boolean: 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: yii\validators\NumberValidator
  • match: yii\validators\RegularExpressionValidator
  • required: yii\validators\RequiredValidator
  • safe: yii\validators\SafeValidator
  • string: yii\validators\StringValidator
  • trim: yii\validators\FilterValidator
  • unique: yii\validators\UniqueValidator
  • url: yii\validators\UrlValidator
  • ip: yii\validators\IpValidator