Hazaar\Application
Request
Abstract
Summary
MethodsPropertiesConstants
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
Methods
__construct()
__construct()
__get()
__get($key)
__unset()
__unset($key)
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

get()
get($key, $default = null) : string|mixed
Retrieve a request value.

These values can be sent in a number of ways.

Only JSON encoded request bodies support data typing. All other request values will be strings.

getActionName()
getActionName()
getBasePath()
getBasePath()
getControllerName()
getControllerName()
getException()
getException()
getParams()
getParams($filter = null) : array
Return an array of request parameters as key/value pairs.
getPath()
getPath($strip_filename = false) : \null|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'.

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'.

get_bool()
get_bool($key, $default = null) : boolean
Retrieve an boolean value from the request

The most common requests will not provide data typing and data value will always be a string. This method will automatically return the requested value as an boolean unless it is NULL or not set. In which case either NULL or the default value will be returned.

This internally uses the boolify() function so the usual bool strings are supported (t, f, true, false, 0, 1, on, off, etc).

get_float()
get_float($key, $default = null) : float
Retrieve an float value from the request

The most common requests will not provide data typing and data value will always be a string. This method will automatically return the requested value as an float unless it is NULL or not set. In which case either NULL or the default value will be returned.

get_int()
get_int($key, $default = null) : int
Retrieve an integer value from the request

The most common requests will not provide data typing and data value will always be a string. This method will automatically return the requested value as an integer unless it is NULL or not set. In which case either NULL or the default value will be returned.

has()
has($keys) : boolean
Check to see if a request value has been set
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

isPOST()
isPOST()
isPUT()
isPUT()
method()
method()
processRoute()
processRoute()
referer()
referer()
remove()
remove($key)
resetAction()
resetAction()
set()
set($key, $value)
Set a request value.

This would not normally be used and has no internal implications on how the application will function as this data is not processed in any way. However setting request data may be useful in your application when reusing/repurposing controller actions so that they may be called from somewhere else in your application.

setActionName()
setActionName($name)
setControllerName()
setControllerName($name)
setDispatched()
setDispatched($flag = true)
setException()
setException($e)
setParams()
setParams($array)