diff --git a/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php b/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php index 64d5616c5ffd2..ff2b84a11c502 100644 --- a/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php +++ b/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php @@ -40,6 +40,25 @@ public function __construct(FileLocatorInterface $locator, TemplateNameParserInt $this->cache = array(); } + /** + * {@inheritdoc} + */ + public function exists($name) + { + // for BC + if ($this->doFindTemplate($name)) { + return true; + } + + try { + $this->findTemplate($name); + + return true; + } catch (\Twig_Error_Loader $e) { + return false; + } + } + /** * Returns the path to the template file. *