Check if we have the source code of a template, given its name.
string $name The name of the template to check if we can load:
boolean If the template source code is handled by this loader or not
Overrides Twig_ExistsLoaderInterface::exists
public function exists($name) {
$name = (string) $name;
if (isset($this->hasSourceCache[$name])) {
return $this->hasSourceCache[$name];
}
foreach ($this->loaders as $loader) {
if ($loader instanceof Twig_ExistsLoaderInterface && $loader
->exists($name)) {
return $this->hasSourceCache[$name] = true;
}
try {
$loader
->getSource($name);
return $this->hasSourceCache[$name] = true;
} catch (Twig_Error_Loader $e) {
}
}
return $this->hasSourceCache[$name] = false;
}