\Hazaar\Application
Request
Abstract
Summary
Methods Properties Constants
get
has
set
No constants
Properties
$action
$action
$base_path
$base_path
The original path excluding the application base path
$config
$config
$controller
$controller
$dispatched
$dispatched
$exception
$exception
$params
$params
$path
$path
The path excluding the controller and action references
$raw_path
$raw_path
The path without the controller reference in it
$response_type
$response_type
Methods
__construct()
__construct()
__get()
__get($key)

Parameters

$key

No description

__unset()
__unset($key)

Parameters

$key

No description

count()
count()
evaluate()
evaluate($string)

Parses a request URL string and turns it into a controller name, action name, and argument list. This is essentially the core method of Hazaar that decides what to execute based on

Parameters

$string

No description

get()
get($key, $default = null)

Parameters

$key

No description

$default

No description

getActionName()
getActionName()
getBasePath()
getBasePath()
getControllerName()
getControllerName()
getException()
getException()
getParams()
getParams($filter = null) : array
Return an array of request parameters as key/value pairs.

Parameters

$filterarray

Only include parameters with keys specified in this filter.

Returns

array
getPath()
getPath() : string

Return the request path suffix. This is the path that comes after the controller and action path elements. Take the path /myapp/public/index/test/foo/bar for example. In this case this method would return ‘/foo/bar’.

Tags

Since

1.0.0

Returns

string

The path suffix of the request URI

getRawPath()
getRawPath() : string

Return the complete raw request URI relative to the application path. That is the full path including the controller and action elements. Take the path /myapp/public/index/test/foo/bar for example. In this case this method would return ‘/index/test/foo/bar’.

Tags

Since

1.0.0

Returns

string

The raw request URI relative to the application path.

getResponseType()
getResponseType() : string
Returns the requested response type.

The requested response type can be set in the request itself. If it is not set, then the default will be ‘html’ or the X-Requested-With header will be checked to determine the response type.

This method is used internally to determine the response type to send when one has not been explicitly used. Normally the response type is determined by the Controller\Response object type returned by a controller action.

Returns

string
has()
has($keys)

Parameters

$keys

No description

hasException()
hasException()
hasParams()
hasParams()
isDELETE()
isDELETE()
isDispatched()
isDispatched()
isGET()
isGET()
isMobileDevice()
isMobileDevice() : boolean
Detect if a request originated on a mobile device

This method will return true to indicate that the requesting device is a mobile browser. It uses the freely available script from detectmobilebrowsers.com

Returns

boolean

True to indicate requesting device is a mobile browser, false otherwise.

isPOST()
isPOST()
isPUT()
isPUT()
method()
method()
processRoute()
processRoute()
referer()
referer()
remove()
remove($key)

Parameters

$key

No description

resetAction()
resetAction()
set()
set($key, $value)

Parameters

$key

No description

$value

No description

setActionName()
setActionName($name)

Parameters

$name

No description

setControllerName()
setControllerName($name)

Parameters

$name

No description

setDispatched()
setDispatched($flag = true)

Parameters

$flag

No description

setException()
setException($e)

Parameters

$e\Hazaar\Application\Exception

No description

setParams()
setParams($array)

Parameters

$arrayarray

No description

setResponseType()
setResponseType($type)

Parameters

$type

No description