PHP Класс Bluz\Proxy\Request

Example of usage use Bluz\Proxy\Request; Request::getParam('foo');
См. также: Zend\Diactoros\RequestTrait::getUri()
Автор: Anton Shevchuk
Наследование: use trait ProxyTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
getAccept ( array $allowTypes = [] ) : string Get Accept MIME Type
getClientIp ( boolean $checkProxy = true ) : string Get the client's IP address
getController ( ) : string Get controller
getCookie ( string $key = null, string $default = null ) : string Retrieve a member of the $_COOKIE super global
getEnv ( string $key = null, string $default = null ) : string Retrieve a member of the $_ENV super global
getFile ( string $name ) : UploadedFile Get uploaded file
getHeader ( string $header, mixed $default = null ) : string Search for a header value
getMethod ( ) : string Get method
getModule ( ) : string Get module
getParam ( string $key, null $default = null ) : mixed Access values contained in the superglobals as public members Order of precedence: 1. GET, 2. POST, 3. COOKIE, 4. SERVER, 5. ENV
getParams ( ) : array Get all params from GET and POST or PUT
getServer ( string $key = null, string $default = null ) : string Retrieve a member of the $_SERVER super global
isCli ( ) : boolean Check CLI
isDelete ( ) : boolean Is this a DELETE method request?
isGet ( ) : boolean Is this a GET method request?
isHttp ( ) : boolean Check HTTP
isPost ( ) : boolean Is this a POST method request?
isPut ( ) : boolean Is this a PUT method request?
isXmlHttpRequest ( ) : boolean Is the request a Javascript XMLHttpRequest?

Защищенные методы

Метод Описание
initInstance ( ) Init instance

Описание методов

getAccept() публичный статический Метод

Get Accept MIME Type
public static getAccept ( array $allowTypes = [] ) : string
$allowTypes array
Результат string

getClientIp() публичный статический Метод

Get the client's IP address
public static getClientIp ( boolean $checkProxy = true ) : string
$checkProxy boolean
Результат string

getController() публичный статический Метод

Get controller
public static getController ( ) : string
Результат string

getCookie() публичный статический Метод

If no $key is passed, returns the entire $_COOKIE array.
public static getCookie ( string $key = null, string $default = null ) : string
$key string
$default string Default value to use if key not found
Результат string Returns null if key does not exist

getEnv() публичный статический Метод

If no $key is passed, returns the entire $_ENV array.
public static getEnv ( string $key = null, string $default = null ) : string
$key string
$default string Default value to use if key not found
Результат string Returns null if key does not exist

getFile() публичный статический Метод

Get uploaded file
public static getFile ( string $name ) : UploadedFile
$name string
Результат Zend\Diactoros\UploadedFile

getHeader() публичный статический Метод

Search for a header value
public static getHeader ( string $header, mixed $default = null ) : string
$header string
$default mixed
Результат string

getMethod() публичный статический Метод

Get method
public static getMethod ( ) : string
Результат string

getModule() публичный статический Метод

Get module
public static getModule ( ) : string
Результат string

getParam() публичный статический Метод

Access values contained in the superglobals as public members Order of precedence: 1. GET, 2. POST, 3. COOKIE, 4. SERVER, 5. ENV
public static getParam ( string $key, null $default = null ) : mixed
$key string
$default null
Результат mixed

getParams() публичный статический Метод

Get all params from GET and POST or PUT
public static getParams ( ) : array
Результат array

getServer() публичный статический Метод

If no $key is passed, returns the entire $_SERVER array.
public static getServer ( string $key = null, string $default = null ) : string
$key string
$default string Default value to use if key not found
Результат string Returns null if key does not exist

initInstance() защищенный статический Метод

Init instance
protected static initInstance ( )

isCli() публичный статический Метод

Check CLI
public static isCli ( ) : boolean
Результат boolean

isDelete() публичный статический Метод

Is this a DELETE method request?
public static isDelete ( ) : boolean
Результат boolean

isGet() публичный статический Метод

Is this a GET method request?
public static isGet ( ) : boolean
Результат boolean

isHttp() публичный статический Метод

Check HTTP
public static isHttp ( ) : boolean
Результат boolean

isPost() публичный статический Метод

Is this a POST method request?
public static isPost ( ) : boolean
Результат boolean

isPut() публичный статический Метод

Is this a PUT method request?
public static isPut ( ) : boolean
Результат boolean

isXmlHttpRequest() публичный статический Метод

Is the request a Javascript XMLHttpRequest?
public static isXmlHttpRequest ( ) : boolean
Результат boolean