ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[TOC] * * * * * ## 1 数据输入文件源代码(thinkphp\library\think\Input.php) `public static $filters;` `public static function get($name = '', $default = null, $filter = null, $merge = false){}` `public static function post($name = '', $default = null, $filter = null, $merge = false){}` `public static function put($name = '', $default = null, $filter = null, $merge = false){}` `public static function delete($name = '', $default = null, $filter = null, $merge = false){}` ` public static function param($name = '', $default = null, $filter = null, $merge = false){}` `public static function request($name = '', $default = null, $filter = null, $merge = false){}` `public static function session($name = '', $default = null, $filter = null, $merge = false){}` `public static function cookie($name = '', $default = null, $filter = null, $merge = false){}` `public static function server($name = '', $default = null, $filter = null, $merge = false){}` `public static function globals($name = '', $default = null, $filter = null, $merge = false){}` `public static function env($name = '', $default = null, $filter = null, $merge = false){}` `public static function path($name = '', $default = null, $filter = null, $merge = false){}` `public static function file($name = '', $default = null, $filter = null, $merge = false){}` `public static function data($input, $name = '', $default = null, $filter = null, $merge = false){}` `public static function has($name, $data){}` `public static function setFilter($name){}` `public static function filterExp(&$value){}` `private static function filter(&$value, $key, $filters){}` `private static function parseName($name){}` `private static function parseFilter($filter, $merge = false){}` `private static function getFilter(){}` `private static function typeCast(&$data, $type){}` ## 2 文件分析 > 1 public方法(17个) 以data()为接口的输入数据获取方法 ~~~ get() post() put() delete() param() request() session() cookie() server() globals() env() path() file() data() has() ~~~ 过滤规则设置方法 `setFilter() filterExp()` > 2 private方法(5个) `filter()` 递归过滤 `parseName()` 解析name `parseFilter()` 解析过滤器 `getFilter()` 获取过滤方法 `typeCast()` 强制类型转换 ## 3 使用方法 TODO ## 4 总结 TODO