class Template implements Template

Latte powered template.

Methods

__construct(Engine $latte)

No description

Engine
getLatte()

No description

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

Renders template to output.

string
renderToString(string|null $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, string|null $language = null)

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)

No description

Parameters

Engine $latte

at line 34
final Engine getLatte()

No description

Return Value

Engine

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

Renders template to output.

Parameters

string|null $file
array $params

Return Value

void

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

Renders template to output.

Parameters

string|null $file
array $params

Return Value

string

at line 64
string __toString()

Renders template to string.

Return Value

string

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

Registers run-time filter.

Parameters

string|null $name
callable $callback

Return Value

Template

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

Registers run-time function.

Parameters

string $name
callable $callback

Return Value

Template

at line 108
Template setTranslator(Translator|null $translator, string|null $language = null)

Sets translate adapter.

Parameters

Translator|null $translator
string|null $language

Return Value

Template

at line 133
Template setFile(string $file)

Sets the path to the template file.

Parameters

string $file

Return Value

Template

at line 140
final string|null getFile()

Returns the path to the template file.

Return Value

string|null

at line 149
final array getParameters()

Returns array of all parameters.

Return Value

array

at line 165
final __wakeup()

Prevents unserialization.