Documentation

TemplateWrapper
in package

Exposes a template to userland.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

$env  : mixed
$template  : mixed
display()  : mixed
Displays the template.
displayBlock()  : mixed
Displays a template block.
getBlockNames()  : array<string|int, string>
Returns defined block names in the template.
getSourceContext()  : Source
getTemplateName()  : string
hasBlock()  : bool
Checks if a block is defined.
render()  : string
Renders the template.
renderBlock()  : string
Renders a template block.

Properties

Methods

display()

Displays the template.

public display([array<string|int, mixed> $context = [] ]) : mixed
Parameters
$context : array<string|int, mixed> = []

An array of parameters to pass to the template

Return values
mixed

displayBlock()

Displays a template block.

public displayBlock(string $name[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
$name : string

The block name to render

$context : array<string|int, mixed> = []

An array of parameters to pass to the template

Return values
mixed

getBlockNames()

Returns defined block names in the template.

public getBlockNames([array<string|int, mixed> $context = [] ]) : array<string|int, string>
Parameters
$context : array<string|int, mixed> = []

An array of parameters to pass to the template

Return values
array<string|int, string>

An array of defined template block names

getTemplateName()

public getTemplateName() : string
Return values
string

hasBlock()

Checks if a block is defined.

public hasBlock(string $name[, array<string|int, mixed> $context = [] ]) : bool
Parameters
$name : string

The block name

$context : array<string|int, mixed> = []

An array of parameters to pass to the template

Return values
bool

render()

Renders the template.

public render([array<string|int, mixed> $context = [] ]) : string
Parameters
$context : array<string|int, mixed> = []

An array of parameters to pass to the template

Return values
string

renderBlock()

Renders a template block.

public renderBlock(string $name[, array<string|int, mixed> $context = [] ]) : string
Parameters
$name : string

The block name to render

$context : array<string|int, mixed> = []

An array of parameters to pass to the template

Return values
string

The rendered block

Search results