<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                Validate 有很大概率會被繼承所以這里列出protected方法和屬性 **protected屬性:** $type = [] -- 自定義驗證類型 $alias = [ '>' => 'gt', '>=' => 'egt', '<' => 'lt', '<=' => 'elt', '=' => 'eq', 'same' => 'eq',] -- 驗證類型別名 $rule = [] -- 當前驗證規則 $message = [] -- 驗證提示信息 $field = [] -- 驗證字段描述 $currentScene="" -- 當前驗證場景 $scene = [] -- 驗證場景定義 $error = [] 或 $error ="" -- 驗證失敗錯誤信息 $batch = false -- 是否批量驗證 $failException = false -- 驗證失敗是否拋出異常 $only = [] -- 場景需要驗證的規則 $remove = [] -- 場景需要移除的驗證規則 $append = [] -- 場景需要追加的驗證規則 $regex = [] -- 驗證正則定義 $db -- Db對象 $lang -- 語言對象 $request -- Request請求對象 $maker = [] -- $typeMsg -- 默認規則提示 ``` $typeMsg = [ 'require' => ':attribute require', 'must' => ':attribute must', 'number' => ':attribute must be numeric', 'integer' => ':attribute must be integer', 'float' => ':attribute must be float', 'boolean' => ':attribute must be bool', 'email' => ':attribute not a valid email address', 'mobile' => ':attribute not a valid mobile', 'array' => ':attribute must be a array', 'accepted' => ':attribute must be yes,on or 1', 'date' => ':attribute not a valid datetime', 'file' => ':attribute not a valid file', 'image' => ':attribute not a valid image', 'alpha' => ':attribute must be alpha', 'alphaNum' => ':attribute must be alpha-numeric', 'alphaDash' => ':attribute must be alpha-numeric, dash, underscore', 'activeUrl' => ':attribute not a valid domain or ip', 'chs' => ':attribute must be chinese', 'chsAlpha' => ':attribute must be chinese or alpha', 'chsAlphaNum' => ':attribute must be chinese,alpha-numeric', 'chsDash' => ':attribute must be chinese,alpha-numeric,underscore, dash', 'url' => ':attribute not a valid url', 'ip' => ':attribute not a valid ip', 'dateFormat' => ':attribute must be dateFormat of :rule', 'in' => ':attribute must be in :rule', 'notIn' => ':attribute be notin :rule', 'between' => ':attribute must between :1 - :2', 'notBetween' => ':attribute not between :1 - :2', 'length' => 'size of :attribute must be :rule', 'max' => 'max size of :attribute must be :rule', 'min' => 'min size of :attribute must be :rule', 'after' => ':attribute cannot be less than :rule', 'before' => ':attribute cannot exceed :rule', 'expire' => ':attribute not within :rule', 'allowIp' => 'access IP is not allowed', 'denyIp' => 'access IP denied', 'confirm' => ':attribute out of accord with :2', 'different' => ':attribute cannot be same with :2', 'egt' => ':attribute must greater than or equal :rule', 'gt' => ':attribute must greater than :rule', 'elt' => ':attribute must less than or equal :rule', 'lt' => ':attribute must less than :rule', 'eq' => ':attribute must equal :rule', 'unique' => ':attribute has exists', 'regex' => ':attribute not conform to the rules', 'method' => 'invalid Request method', 'token' => 'invalid token', 'fileSize' => 'filesize not match', 'fileExt' => 'extensions to upload is not allowed', 'fileMime' => 'mimetype to upload is not allowed', ]; ``` $defaultRegex -- 內置正則驗證規則 ``` $defaultRegex = [ 'alpha' => '/^[A-Za-z]+$/', 'alphaNum' => '/^[A-Za-z0-9]+$/', 'alphaDash' => '/^[A-Za-z0-9\-\_]+$/', 'chs' => '/^[\x{4e00}-\x{9fa5}]+$/u', 'chsAlpha' => '/^[\x{4e00}-\x{9fa5}a-zA-Z]+$/u', 'chsAlphaNum' => '/^[\x{4e00}-\x{9fa5}a-zA-Z0-9]+$/u', 'chsDash' => '/^[\x{4e00}-\x{9fa5}a-zA-Z0-9\_\-]+$/u', 'mobile' => '/^1[3-9]\d{9}$/', 'idCard' => '/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/', 'zip' => '/\d{6}/', ]; ``` $filter -- Filter_var 規則 ``` $filter = [ 'email' => FILTER_VALIDATE_EMAIL, 'ip' => [FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6], 'integer' => FILTER_VALIDATE_INT, 'url' => FILTER_VALIDATE_URL, 'macAddr' => FILTER_VALIDATE_MAC, 'float' => FILTER_VALIDATE_FLOAT, ]; ``` **public方法:** static maker(Closure $maker):void -- 設置服務注入 setLang(Lang $lang):void -- 設置Lang對象 setDb(Db $db):void -- 設置Db對象 setRequest(Request $request):void -- 設置Request對象 rule($name, $rule = ''):Validate -- 添加字段驗證規則 extend(string $type, callable $callback = null, string $message = null):Validate -- 添加字段驗證規則 setTypeMsg($type, string $msg = null): void -- 設置驗證規則的默認提示信息 message(array $message):Validate -- 設置提示信息 scene(string $name):Validate -- 設置驗證場景 hasScene(string $name): bool -- 判斷是否存在某個驗證場景 batch(bool $batch = true):Validate -- 設置批量驗證 failException(bool $fail = true):Validate -- 設置驗證失敗后是否拋出異常 only(array $fields):Validate -- 指定需要驗證的字段列表 remove($field, $rule = null):Validate -- 移除某個字段的驗證規則 append($field, $rule = null):Validate -- 追加某個字段的驗證規則 check(array $data, array $rules = []): bool -- 數據自動驗證 checkRule($value, $rules): bool -- 根據驗證規則驗證數據 confirm($value, $rule, array $data = [], string $field = ''): bool -- 驗證是否和某個字段的值一致 different($value, $rule, array $data = []): bool -- 驗證是否和某個字段的值是否不同 egt($value, $rule, array $data = []): bool -- 驗證是否大于等于某個值 gt($value, $rule, array $data = []): bool -- 驗證是否大于某個值 elt($value, $rule, array $data = []): bool -- 驗證是否小于等于某個值 lt($value, $rule, array $data = []): bool -- 驗證是否小于某個值 eq($value, $rule): bool -- 驗證是否等于某個值 must($value, $rule = null): bool -- 必須驗證 is($value, string $rule, array $data = []): bool -- 驗證字段值是否為有效格式 token($value, string $rule, array $data): bool -- 驗證表單令牌 activeUrl(string $value, string $rule = 'MX'): bool -- 驗證是否為合格的域名或者IP 支持A,MX,NS,SOA,PTR,CNAME,AAAA,A6, SRV,NAPTR,TXT 或者 ANY類型 ip($value, string $rule = 'ipv4'): bool -- 驗證是否有效IP fileExt($file, $rule): bool -- 驗證上傳文件后綴 fileMime($file, $rule): bool -- 驗證上傳文件類型 fileSize($file, $rule): bool -- 驗證上傳文件大小 image($file, $rule): bool -- 驗證圖片的寬高及類型 dateFormat($value, $rule): bool -- 驗證時間和日期是否符合指定格式 unique($value, $rule, array $data = [], string $field = ''): bool -- 驗證是否唯一 filter($value, $rule): bool -- 使用filter_var方式驗證 requireIf($value, $rule, array $data = []): bool -- 驗證某個字段等于某個值的時候必須 requireCallback($value, $rule, array $data = []): bool -- 通過回調方法驗證某個字段是否必須 requireWith($value, $rule, array $data = []): bool -- 驗證某個字段有值的情況下必須 requireWithout($value, $rule, array $data = []): bool -- 驗證某個字段沒有值的情況下必須 in($value, $rule): bool -- 驗證是否在范圍內 notIn($value, $rule): bool -- 驗證是否不在某個范圍 between($value, $rule): bool -- between驗證數據 notBetween($value, $rule): bool -- 使用notbetween驗證數據 length($value, $rule): bool -- 驗證數據長度 max($value, $rule): bool -- 驗證數據最大長度 min($value, $rule): bool -- 驗證數據最小長度 after($value, $rule, array $data = []): bool -- 驗證日期 before($value, $rule, array $data = []): bool -- 驗證日期 afterWith($value, $rule, array $data = []): bool -- 驗證日期 beforeWith($value, $rule, array $data = []): booll -- 驗證日期 expire($value, $rule): bool -- 驗證有效期 allowIp($value, $rule): bool -- 驗證IP許可 denyIp($value, $rule): bool -- 驗證IP禁用 regex($value, $rule): bool -- 使用正則驗證數據 getError():array|string -- 獲取錯誤信息 __call($method, $args):bool -- 動態方法 直接調用is方法進行驗證 **protected方法:** checkItem(string $field, $value, $rules, $data, string $title = '', array $msg = []):mixed -- 驗證單個字段規則 getValidateType($key, $rule): array -- 獲取當前驗證類型及規則 getImageType($image):string|false -- 判斷圖像類型 checkExt(File $file, $ext): bool -- 檢測上傳文件后綴 checkSize(File $file, $size): bool -- 檢測上傳文件大小 checkMime(File $file, $mime): bool -- 檢測上傳文件類型 getDataValue(array $data, $key) -- 獲取數據值 getRuleMsg(string $attribute, string $title, string $type, $rule):string|array -- 獲取驗證規則的錯誤提示信息 parseErrorMsg(string $msg, $rule, string $title):string -- 獲取驗證規則的錯誤提示信息 errorMsgIsArray(array $msg, $rule, string $title):array -- 錯誤信息數組處理 getScene(string $scene): void -- 獲取數據驗證的場景
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看