\Charcoal\App\HandlerHandlerConfig

Summary

Methods
Properties
Constants
setTemplate()
template()
setController()
controller()
defaultController()
setEngine()
engine()
defaultEngine()
setTemplateData()
templateData()
setCache()
cache()
setCacheTtl()
cacheTtl()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$template
$engine
$templateData
$controller
$cache
$cache_ttl
N/A

Properties

$template

$template : string

The template ident (to load).

Type

string

$engine

$engine : string

The view engine ident to use.

Ex: "mustache", ""

Type

string

$templateData

$templateData : array

Additional template data.

Type

array

$controller

$controller : string

Response controller classname

Should be the class-ident of a template controller.

Type

string

$cache

$cache : boolean

Enable route-level caching for this template.

Type

boolean

$cache_ttl

$cache_ttl : integer

If using cache, the time-to-live, in seconds, of the cache. (0 = no limit).

Type

integer

Methods

setTemplate()

setTemplate(string|null  $template) : \Charcoal\App\Handler\HandlerConfig

Parameters

string|null $template

The template identifier.

Throws

\InvalidArgumentException

If the tempalte parameter is not null or not a string.

Returns

\Charcoal\App\Handler\HandlerConfig

Chainable

template()

template() : string

Returns

string

setController()

setController(string  $controller) : \Charcoal\App\Handler\RouteConfig

Set handler view controller classname

Parameters

string $controller

Handler controller name.

Throws

\InvalidArgumentException

If the handler view controller is not a string.

Returns

\Charcoal\App\Handler\RouteConfig —

Chainable

controller()

controller() : string

Get the view controller classname

Returns

string

defaultController()

defaultController() : string

Returns

string

setEngine()

setEngine(string|null  $engine) : \Charcoal\App\Handler\HandlerConfig

Parameters

string|null $engine

The engine identifier (mustache, php, or mustache-php).

Throws

\InvalidArgumentException

If the engine is not null or not a string.

Returns

\Charcoal\App\Handler\HandlerConfig

Chainable

engine()

engine() : string

Returns

string

defaultEngine()

defaultEngine() : string

Returns

string

setTemplateData()

setTemplateData(array  $templateData) : \Charcoal\App\Handler\HandlerConfig

Set the template data for the view.

Parameters

array $templateData

The route template data.

Returns

\Charcoal\App\Handler\HandlerConfig

Chainable

templateData()

templateData() : array

Get the template data for the view.

Returns

array

setCache()

setCache(boolean  $cache) : \Charcoal\App\Handler\HandlerConfig

Parameters

boolean $cache

The cache enabled flag.

Returns

\Charcoal\App\Handler\HandlerConfig

Chainable

cache()

cache() : boolean

Returns

boolean

setCacheTtl()

setCacheTtl(integer  $ttl) : \Charcoal\App\Handler\HandlerConfig

Parameters

integer $ttl

The cache Time-To-Live, in seconds.

Returns

\Charcoal\App\Handler\HandlerConfig

Chainable

cacheTtl()

cacheTtl() : integer

Returns

integer