\Hazaar\Controller
Basic
Abstract
Basic controller class

This controller is a basic controller for directly handling requests. Developers can extend this class to create their own flexible controllers for use in modern AJAX enabled websites that don't require HTML views.

How it works is a request is passed to the controller and the controller is responsible for processing it, creating a new response object and return that object back to the application for processing.

This controller type is typically used for handling AJAX requests as responses to these requests do not require rendering any views. This allows AJAX requests to be processed quickly without the overhead of rendering a view that will never be displayed.

Summary
Methods Properties Constants
No constants
Properties
$__action
$__action
$__actionArgs
$__actionArgs
Static
$__cache
$__cache
$__cache_key
$__cache_key
$__cachedActions
$__cachedActions
Methods
__initialize()
__initialize($request)

Parameters

$request\Hazaar\Application\Request

No description

__run()
__run()
__runAction()
__runAction($action = null) : mixed
Run an action method on a controller

This is the main controller action decision code and is where the controller will decide what to actually execute and whether to cache the response on not.

Tags

Throws

Exception\ActionNotFound

Throws

Exception\ActionNotPublic

Parameters

$actionmixed

The name of the action to run

Returns

mixed
active()
active($controller = null, $action = null) : boolean
Test if a controller and action is active.

Parameters

$controllermixed
$actionmixed

Returns

boolean
cacheAction()
cacheAction($action, $timeout = 60, $public = false)

Parameters

$action

No description

$timeout

No description

$public

No description

cacheResponse()
cacheResponse($response) : boolean
Cache a response to the current action invocation

Parameters

$response\Response

The response to cache

Returns

boolean

True or false from the cache backend indicating if the cache store was successful or not.

getAction()
getAction()
getActionArgs()
getActionArgs()