abort(): 抛出HTTP异常
abort($code,string$message ='',array $header =[])
app(): 快速获取容器中的实例 支持依赖注入
app(string$name ='',array $args =[],bool$newInstance =false)
bind(): 绑定一个类到容器
bind($abstract,$concrete =null)
cache(): 缓存管理
cache(string$name =null,$value ='',$options =null,$tag =null)
config(): 获取和设置配置参数
config($name ='',$value =null)
env(): 获取环境变量值
env(string$name =null,$default =null)
cookie(): Cookie管理
cookie(string$name,$value ='',$option =null)
session(): Session管理
session($name ='',$value ='')
download(): 获取\think\response\Download对象实例
download(string$filename,string$name ='',bool$content =false,int$expire =180)
dump(): 浏览器友好的变量输出
dump(...$vars)
halt(): 调试变量并且中断输出
halt(...$vars)
event(): 触发事件
event($event,$args =null)
input(): 获取输入数据 支持默认值和过滤
input(string$key ='',$default =null,$filter ='')
invoke(): 调用反射实例化对象或者执行方法 支持依赖注入
invoke($call,array $args =[])
json(): 获取\think\response\Json对象实例
json($data =[],$code =200,$header =[],$options =[])
jsonp(): 获取\think\response\Jsonp对象实例
jsonp($data =[],$code =200,$header =[],$options =[])
lang(): 获取语言变量值
lang(string$name,array $vars =[],string$lang ='')
parse_name(): 字符串命名风格转换
parse_name(string$name,int$type =0,bool$ucfirst =true)
redirect(): 获取\think\response\Redirect对象实例
redirect(string$url ='',int$code =302)
request(): 获取当前Request对象实例
request()
response(): 创建普通 Response 对象实例
response($data ='',$code =200,$header =[],$type ='html')
token(): 获取Token令牌
token(string$name ='__token__',string$type ='md5')
token_field(): 生成令牌隐藏表单
token_field(string$name ='__token__',string$type ='md5')
token_meta(): 生成令牌meta
token_meta(string$name ='__token__',string$type ='md5')
trace(): 记录日志信息
trace($log ='[think]',string$level ='log')
url(): Url生成
url(string$url ='',array $vars =[],$suffix =true,$domain =false)
validate(): 生成验证对象
validate($validate ='',array $message =[],bool$batch =false,bool$failException =true)
view(): 渲染模板输出
view(string$template ='',$vars =[],$code =200,$filter =null)
display(): 渲染模板输出
display(string$content,$vars =[],$code =200,$filter =null)
xml(): 获取\think\response\xml对象实例
xml($data =[],$code =200,$header =[],$options =[])
app_path(): 获取当前应用目录
app_path($path ='')
base_path(): 获取应用基础目录
base_path($path ='')
config_path(): 获取应用配置目录
config_path($path ='')
public_path(): 获取web根目录
public_path($path ='')
runtime_path(): 获取应用运行时目录
runtime_path($path ='')
root_path(): 获取项目根目录
root_path($path ='')
来源地址:https://blog.csdn.net/xonmao2008/article/details/129359950