\Phile\Plugin\Phile\TemplateTwig\TemplateTwig

Class Twig

Summary

Methods
Properties
Constants
__construct()
setCurrentPage()
render()
No public properties found
No constants found
doRender()
getEngine()
getTemplateFileName()
getTemplatePath()
getTemplateVars()
$config
$page
$theme
$themesDir
N/A
No private methods found
No private properties found
N/A

Properties

$config

$config :array

Type

array—the config for twig

$theme

$theme :string

Type

string—theme name

$themesDir

$themesDir :string

Type

string—path to theme directory

Methods

__construct()

__construct(array  $config = array())

the constructor

Parameters

array $config

the configuration

setCurrentPage()

setCurrentPage(\Phile\Model\Page  $page): mixed

set current page

Parameters

\Phile\Model\Page $page

Returns

mixed

render()

render(): mixed|string

method to render the page/template

Returns

mixed|string

doRender()

doRender(\Twig_Environment  $engine,array  $vars): string

wrapper to call the render engine

Parameters

\Twig_Environment $engine
array $vars

Returns

string

getEngine()

getEngine(): \Twig_Environment

get template engine

Returns

\Twig_Environment

getTemplateFileName()

getTemplateFileName(): string

get template file name

Throws

\RuntimeException

Returns

string

getTemplatePath()

getTemplatePath(string  $sub = ''): string

get file path to (sub-path) in theme-path

Parameters

string $sub

Returns

string

getTemplateVars()

getTemplateVars(): array

get template vars

Throws

\Exception

Returns

array