Request 请求类¶
| 属性 | 值 |
|---|---|
| 命名空间 | fize\web |
| 类名 | Request |
| 方法: |
|---|
| 方法名 | 说明 |
|---|---|
| __construct() | 初始化静态属性 |
| server() | 获取原生 SERVER |
| get() | 获取 GET 参数 |
| post() | 获取 POST 参数 |
| files() | 获取上传文件 |
| request() | 获取 REQUEST 参数 |
| session() | 获取 SESSION 参数 |
| env() | 获取 ENV 参数 |
| cookie() | 获取 COOKIE 参数 |
| input() | 返回原始输入数据 |
| header() | 获取请求头 |
| contentType() | 当前请求 HTTP_CONTENT_TYPE |
| method() | 当前的请求类型 |
| isGet() | 是否为 GET 请求 |
| isPost() | 是否为 POST 请求 |
| isPut() | 是否为 PUT 请求 |
| isDelete() | 是否为 DELTE 请求 |
| isHead() | 是否为 HEAD 请求 |
| isPatch() | 是否为 PATCH 请求 |
| isOptions() | 是否为 OPTIONS 请求 |
| isCli() | 是否为 cli |
| isCgi() | 是否为 cgi |
| isSsl() | 当前是否 ssl |
| isJson() | 当前是否 JSON 请求 |
| isAjax() | 当前是否 Ajax 请求 |
| isPjax() | 当前是否 Pjax 请求 |
| isMobile() | 检测是否使用手机访问 |
| url() | 返回当前请求 URL |
方法¶
server()¶
获取原生 SERVER
public static function server (
string $key = null,
string $default = null
) : mixed
| 参数: |
|
|---|
get()¶
获取 GET 参数
public static function get (
string $key = null,
string $default = null
) : mixed
| 参数: |
|
|---|
post()¶
获取 POST 参数
public static function post (
string $key = null,
string $default = null
) : mixed
| 参数: |
|
|---|
request()¶
获取 REQUEST 参数
public static function request (
string $key = null
) : mixed
| 参数: |
|
|---|
session()¶
获取 SESSION 参数
public static function session (
string $key = null,
string $default = null
) : mixed
| 参数: |
|
|---|
env()¶
获取 ENV 参数
public static function env (
string $key = null,
string $default = null
) : mixed
| 参数: |
|
|---|
cookie()¶
获取 COOKIE 参数
public static function cookie (
string $key = null,
string $default = null
) : mixed
| 参数: |
|
|---|
header()¶
获取请求头
public static function header (
string $key = null,
mixed $default = null
) : mixed
| 参数: |
|
|---|
url()¶
返回当前请求 URL
public static function url (
bool $host = true,
bool $protocol = true
) : string
| 参数: |
|
|---|