class Engine extends Object

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_URL

Content types

CONTENT_ICAL

Content types

CONTENT_TEXT

Content types

Properties

callable[] $onCompile

Methods

void
render($name, array $params = array())

Renders template to output.

string
renderToString($name, array $params = array())

Renders template to string.

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.

callable[]
getFilters()

Returns all run-time filters.

mixed
invokeFilter($name, array $args)

Call a run-time filter.

addMacro($name, IMacro $macro)

Adds new macro.

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 86
void render($name, array $params = array())

Renders template to output.

Parameters

$name
array $params

Return Value

void

at line 102
string renderToString($name, array $params = array())

Renders template to string.

Parameters

$name
array $params

Return Value

string

at line 122
string compile($name)

Compiles template to PHP code.

Parameters

$name

Return Value

string

at line 160
void warmupCache($name)

Compiles template to cache.

Parameters

$name

Return Value

void

Exceptions

LogicException

at line 233
string getCacheFile($name)

No description

Parameters

$name

Return Value

string

at line 246
string getTemplateClass($name)

No description

Parameters

$name

Return Value

string

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

Registers run-time filter.

Parameters

$name
$callback

Return Value

Engine

at line 273
callable[] getFilters()

Returns all run-time filters.

Return Value

callable[]

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

Call a run-time filter.

Parameters

$name
array $args

Return Value

mixed

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

Adds new macro.

Parameters

$name
IMacro $macro

Return Value

Engine

at line 320
Engine setContentType($type)

No description

Parameters

$type

Return Value

Engine

at line 331
Engine setTempDirectory($path)

Sets path to temporary directory.

Parameters

$path

Return Value

Engine

at line 342
Engine setAutoRefresh($on = TRUE)

Sets auto-refresh mode.

Parameters

$on

Return Value

Engine

at line 352
Parser getParser()

No description

Return Value

Parser

at line 364
Compiler getCompiler()

No description

Return Value

Compiler

at line 378
Engine setLoader(ILoader $loader)

No description

Parameters

ILoader $loader

Return Value

Engine

at line 388
ILoader getLoader()

No description

Return Value

ILoader