public function Twig_Loader_Filesystem::addPath

Adds a path where templates are stored.

Parameters

string $path A path where to look for templates:

string $namespace A path name:

Throws

Twig_Error_Loader

1 call to Twig_Loader_Filesystem::addPath()
Twig_Loader_Filesystem::setPaths in drupal/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php
Sets the paths where templates are stored.

File

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

Class

Twig_Loader_Filesystem
Loads template from the filesystem.

Code

public function addPath($path, $namespace = '__main__') {

  // invalidate the cache
  $this->cache = array();
  if (!is_dir($path)) {
    throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path));
  }
  $this->paths[$namespace][] = rtrim($path, '/\\');
}