\hymieRequest

请求工具类,尽可能使用这个类,这个类获取 $_GET $_POST $_REQUEST 数据时会进行 xss过滤

Summary

Methods
Properties
Constants
getInstance()
__construct()
path()
get()
post()
request()
cookie()
has()
isAjax()
userAgent()
getHeader()
isMobile()
setPath()
getPath()
setConfig()
getConfig()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$instance
$path
$config
$xss
N/A

Properties

$instance

$instance : object

静态实例

Type

object

$path

$path : \hymie\stiring

当前请求的控制器,如果 PATH_INFO 启用则获取 $_SERVER['PATH_INFO']数据 否则从 query_string 中获取

Type

\hymie\stiring

$config

$config : array

url 配置

Type

array

$xss

$xss : \voku\helper\AntiXSS

安全类

Type

\voku\helper\AntiXSS

Methods

getInstance()

getInstance() : void

单例方法

__construct()

__construct() 

构造函数

path()

path(  $xss = false) : void

获取当前请求路径(不包含 query_string 部分)

Parameters

$xss

get()

get(string  $key,   $xss = false) : mixed

$_GET 数据

Parameters

string $key
$xss

Returns

mixed

post()

post(string  $key,   $xss = false) : mixed

$_POST 数据

Parameters

string $key
$xss

Returns

mixed

request()

request(string  $key,   $xss = false) : mixed

request 数据

Parameters

string $key
$xss

Returns

mixed

cookie()

cookie(string  $key,   $xss = false) : mixed

cooke 数据

Parameters

string $key
$xss

Returns

mixed

has()

has(  $key) 

Parameters

$key

isAjax()

isAjax() : boolean

是否是 ajax 请求

Returns

boolean

userAgent()

userAgent() : void

获取 user agent 信息

getHeader()

getHeader(string  $key) : string

根据指定 key 获取头信息

Parameters

string $key

Returns

string

isMobile()

isMobile() : boolean

检查是否是手机端,使用 mobiledetect/mobiledetectlib https://github.com/serbanghita/Mobile-Detect

Returns

boolean

setPath()

setPath(  $value) 

Parameters

$value

getPath()

getPath() 

setConfig()

setConfig(  $value) 

Parameters

$value

getConfig()

getConfig()