Controller

package

Default

Methods

Constructor on run make an instance of the config class, language class and of view class

__construct() 

Get the client's IP address

getClientIp(boolean $checkProxy = true) : string

Arguments

$checkProxy

boolean

Response

string

Get name of controller

getControllerName() : string

Response

string

Retrieve a member of the $_COOKIE superglobal

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

If no $key is passed, returns the entire $_COOKIE array.

Arguments

$key

string

$default

mixed

Default value to use if key not found

Response

mixed

Returns null if key does not exist

Return the method by which the request was made

getMethod() : string

Response

string

Retrieve a member of the $_GET superglobal

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

If no $key is passed, returns the entire $_GET array.

Arguments

$key

string

$default

mixed

Default value to use if key not found

Response

mixed

Returns null if key does not exist

Retrieve a member of the $_POST superglobal

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

If no $key is passed, returns the entire $_POST array.

Arguments

$key

string

$default

mixed

Default value to use if key not found

Response

mixed

Returns null if key does not exist

Retrieve a member of the $_SERVER superglobal

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

If no $key is passed, returns the entire $_SERVER array.

Arguments

$key

string

$default

mixed

Default value to use if key not found

Response

mixed

Returns null if key does not exist

Was the request made by DELETE?

isDelete() : boolean

Response

boolean

Was the request made by GET?

isGet() : boolean

Response

boolean

Was the request made by HEAD?

isHead() : boolean

Response

boolean

Was the request made by OPTIONS?

isOptions() : boolean

Response

boolean

Was the request made by PATCH?

isPatch() : boolean

Response

boolean

Was the request made by POST?

isPost() : boolean

Response

boolean

Was the request made by PUT?

isPut() : boolean

Response

boolean

Redirect to chosen url

redirect(string $url) 
static

Arguments

$url

string

the url to redirect to

Set name of controller

setControllerName( $val) 

Arguments

$val

Properties

view

view : 

Type(s)

language

language : 

Type(s)

name

name : 

Type(s)

config

config : 

Type(s)

flashMessage

flashMessage : 

Type(s)