File
- drupal/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php, line 112
Class
- Twig_Loader_Filesystem
- Loads template from the filesystem.
Code
protected function findTemplate($name) {
$name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/'));
if (isset($this->cache[$name])) {
return $this->cache[$name];
}
$this
->validateName($name);
foreach ($this->paths as $path) {
if (is_file($path . '/' . $name)) {
return $this->cache[$name] = $path . '/' . $name;
}
}
throw new Twig_Error_Loader(sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths)));
}