From d3fe07b1600f50c0b0f926317c3bb01cab21cdfb Mon Sep 17 00:00:00 2001 From: Roy Van Ginneken Date: Sun, 11 Oct 2015 14:15:29 +0200 Subject: [PATCH] [TwigBundle] fixed Include file locations in "Template could not be found" exception --- src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php b/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php index 65afe2a33e..faf5ce3217 100644 --- a/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php +++ b/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php @@ -89,7 +89,10 @@ class FilesystemLoader extends \Twig_Loader_Filesystem } if (false === $file || null === $file) { - throw new \Twig_Error_Loader(sprintf('Unable to find template "%s".', $logicalName), -1, null, $previous); + list($namespace, $name) = $this->parseName($logicalName); + $paths = $this->getPaths($namespace); + array_walk($paths, function (&$path) use ($name) { $path .= '/' . $name; }); + throw new \Twig_Error_Loader(sprintf('Unable to find template "%s" (tried: %s).', $name, implode(', ', $paths)), -1, null, $previous); } return $this->cache[$logicalName] = $file;