Properties

$_template

$_template : 

Template

Type

$_data

$_data : 

Data

Type

$_defaultTemplate

$_defaultTemplate : 

Default Template

Type

$_templateFolder

$_templateFolder : 

Template folder

Type

$_name

$_name : 

Name

Type

$_defaultName

$_defaultName : 

Default Name

Type

$_config

$_config : 

Config

Type

$_content

$_content : 

Content

Type

$_extraCss

$_extraCss : 

Extra css array

Type

$_extraJs

$_extraJs : 

Extra javascript array

Type

$_extraMeta

$_extraMeta : 

Extra Meta array

Type

Methods

__construct()

__construct(string $name, mixed $data, string $template)

Constructor

Parameters

string $name
mixed $data
string $template

, Theme Object (Contaier)

setTemplate()

setTemplate(string $template)

Set template

Parameters

string $template

setData()

setData(mixed $data)

Set data

Parameters

mixed $data

, data injected into the container

getData()

getData() : mixed

Get data

Returns

mixed —

$data , data injected into the container

getTemplateFolder()

getTemplateFolder() : string

Get template folder relative to the theme root

Returns

string

getTemplateFile()

getTemplateFile(string $filename, array $data)

Get rendered template file Accepts one of the types of template files in this order: php (.php), html/mustache (.html), markdown (.md)

Parameters

string $filename

, file without extension

array $data

, associative array of data

Throws

\Exception

, template file does not exist

toHtml()

toHtml( $content,  $data) : string

Output content to html

Parameters

$content
$data

Returns

string

getConfig()

getConfig() : string

Get configuration

Returns

string

getMeta()

getMeta() : string

Get Meta

Returns

string

addMeta()

addMeta(string $name, string $content)

Add meta file to page

Parameters

string $name
string $content

getPageTitle()

getPageTitle()

Get page title

@return string $page_title

getBodyTitle()

getBodyTitle()

Get boby title

@return string $body_title

getCss()

getCss() : array

Get array of css files to include in theme

Returns

array —

$css

addCss()

addCss(string $cssFile)

Add css file to page

Parameters

string $cssFile

, URL of injected css file

getJs()

getJs() : array

Get array of js files to include

Returns

array —

$js

addJs()

addJs(string $jsFile)

Add js file to page

Parameters

string $jsFile

, link to js file

getThemeFolder()

getThemeFolder() : string

Get the theme folder

Returns

string —

$folder

setContent()

setContent(\erdiko\core\Container $content)

Set content

Parameters

\erdiko\core\Container $content

, e.g. View or Layout Object???

getContent()

getContent() : string

Get content

Returns

string —

$content???

getTemplate()

getTemplate() : string

Get template

Returns

string —

$template

setName()

setName(string $name)

Set the theme name, the name is also the id of the theme

Parameters

string $name

, Theme name

getName()

getName() : string

Get name

Returns

string —
  • Return Theme name

getTemplateHtml()

getTemplateHtml(string $partial, string $context) : string

Get template file populated by the config

Parameters

string $partial
string $context

Returns

string —

$html

getContextConfig()

getContextConfig(string $context) : string

Get context config

Parameters

string $context

Returns

string