1 | <?php |
||
12 | class TimedTwigEnvironment extends \Twig_Environment{ |
||
13 | |||
14 | /** |
||
15 | * @var Stopwatch |
||
16 | */ |
||
17 | private $stopwatch = null; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $serverName = 'localhost'; |
||
23 | |||
24 | /** |
||
25 | * @param Stopwatch $stopwatch |
||
26 | * @return $this |
||
27 | */ |
||
28 | public function setStopwatch($stopwatch) |
||
33 | |||
34 | /** |
||
35 | * @param string $serverName |
||
36 | * @return $this |
||
37 | */ |
||
38 | public function setServerName($serverName) |
||
43 | |||
44 | /** |
||
45 | * Renders a template. |
||
46 | * |
||
47 | * @param string $name The template name |
||
48 | * @param array $context An array of parameters to pass to the template |
||
49 | * |
||
50 | * @return string The rendered template |
||
51 | * |
||
52 | * @throws \Twig_Error_Loader When the template cannot be found |
||
53 | * @throws \Twig_Error_Syntax When an error occurred during compilation |
||
54 | * @throws \Twig_Error_Runtime When an error occurred during rendering |
||
55 | */ |
||
56 | public function render($name, array $context = array()) |
||
71 | } |