\Anax\MVCCDispatcherBasic

Dispatching to controllers.

Summary

Methods
Properties
Constants
setDI()
prepareName()
setControllerName()
isValidController()
setActionName()
setParams()
isCallable()
isCallableOrException()
dispatch()
forward()
No public properties found
No constants found
No protected methods found
$di
N/A
No private methods found
$controllerName
$controller
$action
$params
N/A

Properties

$di

$di : 

Properties

Type

$controllerName

$controllerName : 

Properties

Type

$controller

$controller : 

Type

$action

$action : 

Type

$params

$params : 

Type

Methods

setDI()

setDI(\Anax\DI\class  $di) : $this

Set the service container to use

Parameters

\Anax\DI\class $di

a service container

Returns

$this

prepareName()

prepareName(string  $name) : string

Prepare the name.

Parameters

string $name

to prepare.

Returns

string —

as the prepared name.

setControllerName()

setControllerName(string  $name = 'index') : void

Set the name of the controller.

Parameters

string $name

of the controller, defaults to 'index'.

isValidController()

isValidController() : void

Check if a controller exists with this name.

setActionName()

setActionName(string  $name = 'index') : void

Set the name of the action.

Parameters

string $name

of the action, defaults to 'index'.

setParams()

setParams(array  $params = array()) : void

Set the params.

Parameters

array $params

all parameters, defaults to empty.

isCallable()

isCallable() : boolean

Dispatch to a controller, action with parameters.

Returns

boolean

isCallableOrException()

isCallableOrException() : \Anax\MVC\void.

Inspect if callable and throw exception if parts is not callable.

Returns

\Anax\MVC\void.

dispatch()

dispatch() : mixed

Dispatch to a controller, action with parameters.

Returns

mixed —

result from dispatched controller action.

forward()

forward(array  $forward = array()) : mixed

Forward to a controller, action with parameters.

Parameters

array $forward

with details for controller, action, parameters.

Returns

mixed —

result from dispatched controller action.