function FilesystemLoader::addPath
Same name in this branch
- 11.1.x core/lib/Drupal/Core/Template/Loader/FilesystemLoader.php \Drupal\Core\Template\Loader\FilesystemLoader::addPath()
Throws
1 call to FilesystemLoader::addPath()
- FilesystemLoader::setPaths in vendor/
twig/ twig/ src/ Loader/ FilesystemLoader.php
1 method overrides FilesystemLoader::addPath()
- FilesystemLoader::addPath in core/
lib/ Drupal/ Core/ Template/ Loader/ FilesystemLoader.php - Adds a path where templates are stored.
File
-
vendor/
twig/ twig/ src/ Loader/ FilesystemLoader.php, line 92
Class
- FilesystemLoader
- Loads template from the filesystem.
Namespace
Twig\LoaderCode
public function addPath(string $path, string $namespace = self::MAIN_NAMESPACE) : void {
// invalidate the cache
$this->cache = $this->errorCache = [];
$checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath . $path;
if (!is_dir($checkPath)) {
throw new LoaderError(\sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath));
}
$this->paths[$namespace][] = rtrim($path, '/\\');
}