Skip to content

Commit d3fe07b

Browse files
rvanginnekenjaviereguiluz
authored andcommitted
[TwigBundle] fixed Include file locations in "Template could not be found" exception
1 parent b702448 commit d3fe07b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ protected function findTemplate($template, $throw = true)
8989
}
9090

9191
if (false === $file || null === $file) {
92-
throw new \Twig_Error_Loader(sprintf('Unable to find template "%s".', $logicalName), -1, null, $previous);
92+
list($namespace, $name) = $this->parseName($logicalName);
93+
$paths = $this->getPaths($namespace);
94+
array_walk($paths, function (&$path) use ($name) { $path .= '/' . $name; });
95+
throw new \Twig_Error_Loader(sprintf('Unable to find template "%s" (tried: %s).', $name, implode(', ', $paths)), -1, null, $previous);
9396
}
9497

9598
return $this->cache[$logicalName] = $file;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy