Twig API
Interface

Twig_TemplateInterface

interface Twig_TemplateInterface

Interface implemented by all compiled templates.

Constants

ANY_CALL

ARRAY_CALL

METHOD_CALL

Methods

string render(array $context)

Renders the template with the given context and returns it as string.

display(array $context, array $blocks = array())

Displays the template with the given context.

Twig_Environment getEnvironment()

Returns the bound environment for this template.

Details

at line 31
public string render(array $context)

Renders the template with the given context and returns it as string.

Parameters

array $context An array of parameters to pass to the template

Return Value

string The rendered template

at line 39
public display(array $context, array $blocks = array())

Displays the template with the given context.

Parameters

array $context An array of parameters to pass to the template
array $blocks An array of blocks to pass to the template

at line 46
public Twig_Environment getEnvironment()

Returns the bound environment for this template.

Return Value

Twig_Environment The current environment