class Template implements ITemplate

Latte powered template.

Methods

__construct(Engine $latte)

No description

Engine
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(ITranslator|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.

add(string $name, $value)

Adds new template parameter.

setParameters(array $params)

Sets all parameters.

array
getParameters()

Returns array of all parameters.

void
__set($name, $value)

Sets a template parameter. Do not call directly.

mixed
__get($name)

Returns a template parameter. Do not call directly.

__isset($name)

Determines whether parameter is defined. Do not call directly.

void
__unset(string $name)

Removes a template parameter. Do not call directly.

__wakeup()

Prevents unserialization.

Details

at line 33
__construct(Engine $latte)

No description

Parameters

Engine $latte

at line 39
final Engine getLatte()

No description

Return Value

Engine

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

Renders template to output.

Parameters

string $file
array $params

Return Value

void

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

Renders template to output.

Parameters

string $file
array $params

Return Value

string

at line 67
string __toString()

Renders template to string.

Return Value

string

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

Registers run-time filter.

Parameters

string|null $name
callable $callback

Return Value

Template

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

Registers run-time function.

Parameters

string $name
callable $callback

Return Value

Template

at line 110
Template setTranslator(ITranslator|null $translator)

Sets translate adapter.

Parameters

ITranslator|null $translator

Return Value

Template

at line 128
ITemplate setFile(string $file)

Sets the path to the template file.

Parameters

string $file

Return Value

ITemplate

at line 135
final string|null getFile()

Returns the path to the template file.

Return Value

string|null

at line 145
Template add(string $name, $value)

Adds new template parameter.

Parameters

string $name
$value

Return Value

Template

at line 159
Template setParameters(array $params)

Sets all parameters.

Parameters

array $params

Return Value

Template

at line 169
final array getParameters()

Returns array of all parameters.

Return Value

array

at line 178
void __set($name, $value)

Sets a template parameter. Do not call directly.

Parameters

$name
$value

Return Value

void

at line 188
mixed __get($name)

Returns a template parameter. Do not call directly.

Parameters

$name

Return Value

mixed value

at line 201
__isset($name)

Determines whether parameter is defined. Do not call directly.

Parameters

$name

at line 210
void __unset(string $name)

Removes a template parameter. Do not call directly.

Parameters

string $name

Return Value

void

at line 219
final __wakeup()

Prevents unserialization.

Traits

SmartObject