1. 程式人生 > >Yii2 rules驗證規則

Yii2 rules驗證規則

Array
(
    [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] => Array
        (
            [class] => yii\validators\NumberValidator
            [integerOnly] => 1
        )

    [match] => yii\validators\RegularExpressionValidator
    [number] => yii\validators\NumberValidator
    [required] => yii\validators\RequiredValidator
    [safe] => yii\validators\SafeValidator
    [string] => yii\validators\StringValidator
    [trim] => Array
        (
            [class] => yii\validators\FilterValidator
            [filter] => trim
            [skipOnArray] => 1
        )

    [unique] => yii\validators\UniqueValidator
    [url] => yii\validators\UrlValidator
    [ip] => yii\validators\IpValidator
)