TemplateWrapper

Exposes a template to userland.

author

Fabien Potencier fabien@symfony.com

package

Default

Methods

Displays the template.

display(array $context = array())

Arguments

$context

array

An array of parameters to pass to the template

Displays a template block.

displayBlock(string $name,array $context = array())

Arguments

$name

string

The block name to render

$context

array

An array of parameters to pass to the template

Returns defined block names in the template.

getBlockNames(array $context = array()): array<mixed,string>

Arguments

$context

array

An array of parameters to pass to the template

Response

array<mixed,string>

An array of defined template block names

getSourceContext

getSourceContext(): \Twig\Source

Response

\Twig\Source

getTemplateName

getTemplateName(): string

Response

string

Checks if a block is defined.

hasBlock(string $name,array $context = array()): boolean

Arguments

$name

string

The block name

$context

array

An array of parameters to pass to the template

Response

boolean

Renders the template.

render(array $context = array()): string

Arguments

$context

array

An array of parameters to pass to the template

Response

string

The rendered template

Renders a template block.

renderBlock(string $name,array $context = array()): string

Arguments

$name

string

The block name to render

$context

array

An array of parameters to pass to the template

Response

string

The rendered block

Properties

env

env :

Type(s)

template

template :

Type(s)