\Anax\ThemeEngineCThemeEngine

Anax base class for wrapping sessions.

Summary

Methods
Properties
Constants
configure()
setDI()
setTemplate()
setTitle()
setBaseTitle()
setVariable()
addFrontmatter()
getVariable()
addStylesheet()
addJavaScript()
render()
No public properties found
No constants found
No protected methods found
$di
$data
$template
N/A
No private methods found
$config
N/A

Properties

$di

$di : 

Properties

Type

$data

$data : 

Array with variables to provide to theme template files.

Type

$template

$template : 

Overwrite template file as defined in config.

Type

$config

$config : 

Properties

Type

Methods

configure()

configure(\Anax\array/string  $what) : $this

Read configuration from file or array'.

Parameters

\Anax\array/string $what

is an array with key/value config options or a file to be included which returns such an array.

Returns

$this —

for chaining.

setDI()

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

Set the service container to use

Parameters

\Anax\DI\class $di

a service container

Returns

$this

setTemplate()

setTemplate(string  $name) : $this

Set another template file to use.

Parameters

string $name

of the template file.

Returns

$this

setTitle()

setTitle(string  $value) : $this

Shortcut to set title.

Parameters

string $value

of the variable.

Returns

$this

setBaseTitle()

setBaseTitle(string  $value) : $this

Set a base title which is appended to the page title.

Parameters

string $value

of the variable.

Returns

$this

setVariable()

setVariable(string  $which, mixed  $value) : $this

Set a variable which will be exposed to the template files during render.

Parameters

string $which

variable to set value of.

mixed $value

of the variable.

Returns

$this

addFrontmatter()

addFrontmatter(array|null  $matter) : $this

Add frontmatter to be exposed to theme template file.

Parameters

array|null $matter

to add.

Returns

$this

getVariable()

getVariable(string  $which) : mixed

Get a value of a variable which will be exposed to the template files during render.

Parameters

string $which

variable to get value of.

Returns

mixed —

as value of variable, or null if value is not set.

addStylesheet()

addStylesheet(string  $uri) : $this

Add a stylesheet.

Parameters

string $uri

to add.

Returns

$this

addJavaScript()

addJavaScript(string  $uri) : $this

Add a javascript asset.

Parameters

string $uri

to add.

Returns

$this

render()

render() : void

Render the theme by applying the variables onto the template files.