protected function findTemplate($name) {
// normalize 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)));
}