Symfony2 API
Class

Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine

class TimedTwigEngine extends TwigEngine

Times the time spent to render a template.

Methods

__construct(Twig_Environment $environment, TemplateNameParserInterface $parser, FileLocatorInterface $locator, Stopwatch $stopwatch, GlobalVariables $globals = null)

Constructor.

setDefaultEscapingStrategy($strategy)

from TwigEngine
guessDefaultEscapingStrategy($filename)

from TwigEngine
string render(mixed $name, array $parameters = array())

Renders a template.

Response renderResponse(string $view, array $parameters = array(), Response $response = null)

Renders a view and returns a Response.

from TwigEngine

Details

at line 38
public __construct(Twig_Environment $environment, TemplateNameParserInterface $parser, FileLocatorInterface $locator, Stopwatch $stopwatch, GlobalVariables $globals = null)

Constructor.

Parameters

Twig_Environment $environment A \Twig_Environment instance
TemplateNameParserInterface $parser A TemplateNameParserInterface instance
FileLocatorInterface $locator A FileLocatorInterface instance
Stopwatch $stopwatch A Stopwatch instance
GlobalVariables $globals A GlobalVariables instance

in TwigEngine at line 44
public setDefaultEscapingStrategy($strategy)

Parameters

$strategy

in TwigEngine at line 49
public guessDefaultEscapingStrategy($filename)

Parameters

$filename

at line 48
public string render(mixed $name, array $parameters = array())

Renders a template.

Parameters

mixed $name A template name
array $parameters An array of parameters to pass to the template

Return Value

string The evaluated template as a string

Exceptions

RuntimeException if the template cannot be rendered

in TwigEngine at line 102
public Response renderResponse(string $view, array $parameters = array(), Response $response = null)

Renders a view and returns a Response.

Parameters

string $view The view name
array $parameters An array of parameters to pass to the view
Response $response A Response instance

Return Value

Response A Response instance