Zhamao Framework 3.2.4
A high-performance chatbot + web framework
载入中...
搜索中...
未找到
HttpUtil类 参考

静态 Public 成员函数

static parseUri (RequestInterface $request, mixed &$node, mixed &$params)
 
static handleStaticPage (string $uri, array $settings=[])
 
static handleHttpCodePage (int $code)
 
static createJsonResponse (array $data, int $http_code=200, int $json_flag=JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE)
 
static getRouteCollection ()
 

详细描述

Http 工具类

成员函数说明

◆ createJsonResponse()

static createJsonResponse ( array  $data,
int  $http_code = 200,
int  $json_flag = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE 
)
static

快速创建一个 JSON 格式的 HTTP 响应

参数
array$data数据
int$http_codeHTTP 状态码
int$json_flagJSON 编码时传入的flag

◆ getRouteCollection()

static getRouteCollection ( )
static

◆ handleHttpCodePage()

static handleHttpCodePage ( int  $code)
static

自动寻找默认的 HTTP Code 页面

异常
ConfigException
函数调用图:

◆ handleStaticPage()

static handleStaticPage ( string  $uri,
array  $settings = [] 
)
static

解析返回静态文件

@params string $uri 路由地址 @params string $settings 动态传入的配置模式

异常
ConfigException
函数调用图:

◆ parseUri()

static parseUri ( RequestInterface  $request,
mixed &  $node,
mixed &  $params 
)
static

解析 Uri,用于匹配路由用的 返回值为状态 第二个参数为路由节点 第三个参数为动态路由节点中匹配到的参数列表


该类的文档由以下文件生成: