\Ceo\Modules\Frontend\ControllersErrorController

Error controller

Summary

Methods
Properties
Constants
initialize()
indexAction()
licenseAction()
error500Action()
error401Action()
No public properties found
No constants found
enableCompatibilityView()
terminateWithView()
getHttpCodeDescription()
getRequestSegments()
getJsonData()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

initialize()

initialize() 

Initialize response headers

indexAction()

indexAction(  $message,   $code = 404) 

Handle the display of error messages

Returns the following to the view:

  • message - the error message string
  • code - the error code (HTTP status code)

Looks for templates in the following order:

  • error/XXX.twig - code specific
  • error/index.twig

Then fails over to global templates:

  • global-errors/XXX.twig - code specific
  • global-errors/500.twig

Parameters

$message
$code

licenseAction()

licenseAction(  $message,   $code = 500) 

Handle the display of license error messages

Returns the following to the view:

  • message - the error message string

Looks for templates in the following order:

  • error/index.twig

Parameters

$message
$code

error500Action()

error500Action() 

error401Action()

error401Action() 

enableCompatibilityView()

enableCompatibilityView(string  $view) : boolean

Enables path to Gryphon compatible view, if the view exists AND enableCompatibility is on.

NOTE: This will mutate the internal view.

Parameters

string $view

Returns

boolean

terminateWithView()

terminateWithView(string  $view, array  $params = array(), array  $headers = array()) 

Terminate the action with a view partial. Will dump output directly to browser, but return the action allowing process to continue.

Parameters

string $view

path

array $params

view params

array $headers

optional headers

getHttpCodeDescription()

getHttpCodeDescription(  $code) 

Parameters

$code

getRequestSegments()

getRequestSegments(  $i = null) : mixed

Return rewrite url segments

Parameters

$i

Returns

mixed —

either all segments as array, or single segment

getJsonData()

getJsonData() : array

Fetch POSTed/PUTed json data

Returns

array