/** * Renders a template. * * @param string $name The template name * @param array $context An array of parameters to pass to the template * * @return string The rendered template * * @throws \Twig_Error_Loader When the template cannot be found * @throws \Twig_Error_Syntax When an error occurred during compilation * @throws \Twig_Error_Runtime When an error occurred during rendering */ public function render($name, array $context = array()) { $e = $this->stopwatch->start(array('server' => 'localhost', 'group' => 'twig::render', 'twig_template' => (string) $name)); $ret = $this->environment->render($name, $context); $e->stop(); return $ret; }
/** * @param $methodName * @return StopwatchEvent|null */ protected function getStopwatchEvent($methodName) { if (!$this->stopwatch) { return null; } $tags = $this->stopwatchAdditionalTags; $tags['group'] = 'filesystem::' . $methodName; return $this->stopwatch->start($tags); }