templateService = $templateService; } /** * @return array */ public function getFunctions() { return array( new \Twig_SimpleFunction('template_exists', array($this, 'templateExists')), ); } /** * @param string $name * * @return boolean */ public function templateExists($name) { return $this->templateService->exists($name); } /** * @return string */ public function getName() { return 'template_extension'; } }