\Anax\RequestCRequestBasic

Storing information from the request and calculating related essentials.

Summary

Methods
Properties
Constants
__construct()
setGlobals()
init()
getSiteUrl()
getBaseUrl()
getScriptName()
getRouteParts()
getRoute()
extractRoute()
getCurrentUrl()
getServer()
setServer()
getGet()
setGet()
getPost()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$requestUri
$scriptName
$path
$route
$routeParts
$currentUrl
$siteUrl
$baseUrl
$server
$get
$post
N/A

Properties

$requestUri

$requestUri : 

Properties

Type

$scriptName

$scriptName : 

Type

$path

$path : 

Type

$route

$route : 

Type

$routeParts

$routeParts : 

Type

$currentUrl

$currentUrl : 

Type

$siteUrl

$siteUrl : 

Type

$baseUrl

$baseUrl : 

Type

$server

$server : 

Type

$get

$get : 

Type

$post

$post : 

Type

Methods

__construct()

__construct() 

Constructor.

setGlobals()

setGlobals(array  $globals = array()) : void

Read info from the globals.

Parameters

array $globals

use to initiate globals with values.

init()

init() : $this

Init the request class by reading information from the request.

Returns

$this

getSiteUrl()

getSiteUrl() : string

Get site url.

Returns

string

getBaseUrl()

getBaseUrl() : string

Get base url.

Returns

string

getScriptName()

getScriptName() : string

Get script name.

Returns

string

getRouteParts()

getRouteParts() : array

Get route parts.

Returns

array

getRoute()

getRoute() : string

Get the route.

Returns

string —

as the current extracted route

extractRoute()

extractRoute() : string

Extract the part containing the route.

Returns

string —

as the current extracted route

getCurrentUrl()

getCurrentUrl() : string

Get the current url.

Returns

string —

as current url.

getServer()

getServer(string  $key, string  $default = null) : mixed

Get a value from the _SERVER array and use default if it is not set.

Parameters

string $key

to check if it exists in the $_SERVER variable

string $default

value to return as default

Returns

mixed

setServer()

setServer(mixed  $key, string  $value = null) : $this

Set variable in the server array.

Parameters

mixed $key

the key an the , or an key-value array

string $value

the value of the key

Returns

$this

getGet()

getGet(string  $key, string  $default = null) : mixed

Get a value from the _GET array and use default if it is not set.

Parameters

string $key

to check if it exists in the $_GET variable

string $default

value to return as default

Returns

mixed

setGet()

setGet(mixed  $key, string  $value = null) : $this

Set variable in the get array.

Parameters

mixed $key

the key an the , or an key-value array

string $value

the value of the key

Returns

$this

getPost()

getPost(string  $key = null, string  $default = null) : mixed

Get a value from the _POST array and use default if it is not set.

Parameters

string $key

to check if it exists in the $_POST variable

string $default

value to return as default

Returns

mixed