\Alo\ControllerError

Default error controller

Summary

Methods
Properties
Constants
__construct()
index()
__destruct()
error()
displayErrorPage()
No public properties found
No constants found
echoOnDestruct()
http_error()
loadView()
No protected properties found
N/A
No private methods found
$echo_on_destruct
N/A

Properties

$echo_on_destruct

$echo_on_destruct : boolean

Whether to echo contents on object destruct

Type

boolean

Methods

__construct()

__construct(boolean  $echo_on_destruct = true) 

Instantiates the class

Parameters

boolean $echo_on_destruct

Whether to echo contents on object destruct

index()

index() 

Method to avoid errors. Should always be overridden.

__destruct()

__destruct() 

Closure operations

error()

error(integer  $code = 404, string  $message = null) 

Displays the error page

Parameters

integer $code

The error HTTP code

string $message

Optional message override

displayErrorPage()

displayErrorPage(integer  $code = 404) 

Displays a generic error page for which there is no HTML file

Parameters

integer $code

The HTTP response code

echoOnDestruct()

echoOnDestruct(boolean|null  $switch = null) : boolean|\Alo\Controller\AbstractController

Returns if echoOnDestruct is true or false if called without a parameter or sets it to true/false if the parameter is set

Parameters

boolean|null $switch

The parameter

Returns

boolean|\Alo\Controller\AbstractController

http_error()

http_error(integer  $code = 404) 

Forces a HTTP error page to be displayed instead

Parameters

integer $code

The HTTP response code

loadView()

loadView(string  $name, array  $params = array(), boolean  $return = false) : null|string

Loads a view

Parameters

string $name

The name of the view without ".php".

array $params

Associative array of parameters to pass on to the view

boolean $return

If set to TRUE, will return the view, if FALSE, will echo it

Returns

null|string