\Fuman_Request

Represents current Request Object. Get and Post will be merged to one single parameter argument

Summary

Methods
Properties
Constants
__construct()
getUniqueId()
setUriParams()
getUriParams()
hasParam()
hasParams()
getParam()
getParams()
setParam()
getParamKeys()
hasHeader()
getHeader()
isAjaxRequest()
isGetRequest()
isPostRequest()
No public properties found
No constants found
_prepareRequest()
_prepareHeaders()
$_params
$_uriParams
$_headers
$_isAjaxRequest
$_isGetRequest
$_isPostRequest
$_uniqueId
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

Parameters of request. The values of this array are prepared by {@link Fuman_Helper_Security}

Type

array

$_uriParams

$_uriParams : \stdClass

Parsed object of current uri. Parsed by Fuman_Uri_AbstractBuilder.

Use object to manipulate current uri.

Type

\stdClass

$_headers

$_headers : array

List of Request Headers

Type

array

$_isAjaxRequest

$_isAjaxRequest : boolean

True when request is a ajax-request

Type

boolean

$_isGetRequest

$_isGetRequest : boolean

True when a $_GET request

Type

boolean

$_isPostRequest

$_isPostRequest : boolean

True when a $_POST request

Type

boolean

$_uniqueId

$_uniqueId : string

Unique Id of Request

Type

string

Methods

__construct()

__construct(string  $webRoot) : \Fuman_Request

Constructor

Parameters

string $webRoot

Web root of app

Returns

\Fuman_Request

getUniqueId()

getUniqueId() : string

Returns unique Id of request

Returns

string

setUriParams()

setUriParams(array|null  $params = null) : void

Parsed array from Fuman_Uri_AbstractBuilder.

Parameters

array|null $params

getUriParams()

getUriParams() : \stdClass

Returns uri Params

Returns

\stdClass

hasParam()

hasParam(string  $key) : boolean

Returns true when Param with $key is set.

Parameters

string $key

Returns

boolean

hasParams()

hasParams(array  $keys) : boolean

Returns true when all given keys are set

Parameters

array $keys

Returns

boolean

getParam()

getParam(string  $key, null|string|array  $defaultValue = null) : string|array

Returns a Parameter by key.

Parameters

string $key
null|string|array $defaultValue

Returns

string|array

getParams()

getParams(string|null  $regex = null) : array

Returns a list of params

Parameters

string|null $regex

Returns

array

setParam()

setParam(string  $key, string  $value) 

Sets parameter

Parameters

string $key
string $value

getParamKeys()

getParamKeys() : array

Returns all Param Keys

Returns

array

hasHeader()

hasHeader(string  $name) : boolean

Returns true when a header with name $name is set

Parameters

string $name

Returns

boolean

getHeader()

getHeader(string  $name) : string

Returns header value by name

Parameters

string $name

Returns

string

isAjaxRequest()

isAjaxRequest() : boolean

Returns true when Request is a Ajax Reuqest

Returns

boolean

isGetRequest()

isGetRequest() : boolean

Returns true when Request is a $_POST Reuqest

Returns

boolean

isPostRequest()

isPostRequest() : boolean

Returns true when Request is a $_GET Reuqest

Returns

boolean

_prepareRequest()

_prepareRequest(array  $request) : void

Prepares Request.

Parameters

array $request

_prepareHeaders()

_prepareHeaders(array  $headers) : void

Prepare headers

Parameters

array $headers