class Template implements Template

Latte powered template.

Methods

__construct(Engine $latte)

No description

getLatte()

No description

void
render(string $file = null, array $params = [])

Renders template to output.

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

Renders template to output.

string
__toString()

Renders template to string.

addFilter(string|null $name, callable $callback)

Registers run-time filter.

addFunction(string $name, callable $callback)

Registers run-time function.

setTranslator(Translator|null $translator)

Sets translate adapter.

setFile(string $file)

Sets the path to the template file.

string|null
getFile()

Returns the path to the template file.

array
getParameters()

Returns array of all parameters.

__wakeup()

Prevents unserialization.

Details

at line 28
__construct(Engine $latte)

Parameters

Engine $latte

at line 34
final Engine getLatte()

Return Value

Engine

at line 43
void render(string $file = null, array $params = [])

Renders template to output.

Parameters

string $file
array $params

Return Value

void

at line 53
string renderToString(string $file = null, array $params = [])

Renders template to output.

Parameters

string $file
array $params

Return Value

string

at line 64
string __toString()

Renders template to string.

Return Value

string

at line 85
Template addFilter(string|null $name, callable $callback)

Registers run-time filter.

Parameters

string|null $name
callable $callback

Return Value

Template

at line 96
Template addFunction(string $name, callable $callback)

Registers run-time function.

Parameters

string $name
callable $callback

Return Value

Template

at line 107
Template setTranslator(Translator|null $translator)

Sets translate adapter.

Parameters

Translator|null $translator

Return Value

Template

at line 125
Template setFile(string $file)

Sets the path to the template file.

Parameters

string $file

Return Value

Template

at line 132
final string|null getFile()

Returns the path to the template file.

Return Value

string|null

at line 141
final array getParameters()

Returns array of all parameters.

Return Value

array

at line 156
final __wakeup()

Prevents unserialization.