class Engine

Templating engine Latte.

Constants

VERSION

CONTENT_HTML

Content types

CONTENT_XHTML

Content types

CONTENT_XML

Content types

CONTENT_JS

Content types

CONTENT_CSS

Content types

CONTENT_ICAL

Content types

CONTENT_TEXT

Content types

Properties

callable[] $onCompile

Methods

__construct()

No description

void
render($name, array $params = [], $block = null)

Renders template to output.

string
renderToString($name, array $params = [], $block = null)

Renders template to string.

createTemplate($name, array $params = [])

Creates template object.

string
compile($name)

Compiles template to PHP code.

void
warmupCache($name)

Compiles template to cache.

string
getCacheFile($name)

No description

string
getTemplateClass($name)

No description

addFilter($name, $callback)

Registers run-time filter.

string[]
getFilters()

Returns all run-time filters.

mixed
invokeFilter($name, array $args)

Call a run-time filter.

addMacro($name, IMacro $macro)

Adds new macro.

addProvider($name, $value)

Adds new provider.

array
getProviders()

Returns all providers.

setContentType($type)

No description

setTempDirectory($path)

Sets path to temporary directory.

setAutoRefresh($on = true)

Sets auto-refresh mode.

getParser()

No description

getCompiler()

No description

setLoader(ILoader $loader)

No description

getLoader()

No description

Details

at line 57
__construct()

No description

at line 67
void render($name, array $params = [], $block = null)

Renders template to output.

Parameters

$name
array $params
$block

Return Value

void

at line 78
string renderToString($name, array $params = [], $block = null)

Renders template to string.

Parameters

$name
array $params
$block

Return Value

string

at line 89
Template createTemplate($name, array $params = [])

Creates template object.

Parameters

$name
array $params

Return Value

Template

at line 103
string compile($name)

Compiles template to PHP code.

Parameters

$name

Return Value

string

at line 141
void warmupCache($name)

Compiles template to cache.

Parameters

$name

Return Value

void

Exceptions

LogicException

at line 219
string getCacheFile($name)

No description

Parameters

$name

Return Value

string

at line 232
string getTemplateClass($name)

No description

Parameters

$name

Return Value

string

at line 245
Engine addFilter($name, $callback)

Registers run-time filter.

Parameters

$name
$callback

Return Value

Engine

at line 256
string[] getFilters()

Returns all run-time filters.

Return Value

string[]

at line 268
mixed invokeFilter($name, array $args)

Call a run-time filter.

Parameters

$name
array $args

Return Value

mixed

at line 278
Engine addMacro($name, IMacro $macro)

Adds new macro.

Parameters

$name
IMacro $macro

Return Value

Engine

at line 289
Engine addProvider($name, $value)

Adds new provider.

Parameters

$name
$value

Return Value

Engine

at line 300
array getProviders()

Returns all providers.

Return Value

array

at line 309
Engine setContentType($type)

No description

Parameters

$type

Return Value

Engine

at line 320
Engine setTempDirectory($path)

Sets path to temporary directory.

Parameters

$path

Return Value

Engine

at line 331
Engine setAutoRefresh($on = true)

Sets auto-refresh mode.

Parameters

$on

Return Value

Engine

at line 341
Parser getParser()

No description

Return Value

Parser

at line 353
Compiler getCompiler()

No description

Return Value

Compiler

at line 367
Engine setLoader(ILoader $loader)

No description

Parameters

ILoader $loader

Return Value

Engine

at line 377
ILoader getLoader()

No description

Return Value

ILoader

Traits

Better OOP experience.