public function Twig_Loader_Filesystem::exists

Check if we have the source code of a template, given its name.

Parameters

string $name The name of the template to check if we can load:

Return value

boolean If the template source code is handled by this loader or not

Overrides Twig_ExistsLoaderInterface::exists

File

drupal/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php, line 139

Class

Twig_Loader_Filesystem
Loads template from the filesystem.

Code

public function exists($name) {
  $name = (string) $name;
  if (isset($this->cache[$name])) {
    return true;
  }
  try {
    $this
      ->findTemplate($name);
    return true;
  } catch (Twig_Error_Loader $exception) {
    return false;
  }
}