[TwigBundle] fixed Include file locations in "Template could not be found" exception
This commit is contained in:
parent
b7024483e3
commit
d3fe07b160
@ -89,7 +89,10 @@ class FilesystemLoader extends \Twig_Loader_Filesystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (false === $file || null === $file) {
|
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;
|
return $this->cache[$logicalName] = $file;
|
||||||
|
Reference in New Issue
Block a user