Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FilesystemLoader.php

function FilesystemLoader::addPath

Same name in this branch
  1. 11.1.x vendor/twig/twig/src/Loader/FilesystemLoader.php \Twig\Loader\FilesystemLoader::addPath()

Adds a path where templates are stored.

Parameters

string $path: A path where to look for templates.

string $namespace: (optional) A path name.

Overrides FilesystemLoader::addPath

1 call to FilesystemLoader::addPath()
FilesystemLoader::__construct in core/lib/Drupal/Core/Template/Loader/FilesystemLoader.php
Constructs a new FilesystemLoader object.

File

core/lib/Drupal/Core/Template/Loader/FilesystemLoader.php, line 72

Class

FilesystemLoader
Loads templates from the filesystem.

Namespace

Drupal\Core\Template\Loader

Code

public function addPath(string $path, string $namespace = self::MAIN_NAMESPACE) : void {
    // Invalidate the cache.
    $this->cache = [];
    $this->paths[$namespace][] = rtrim($path, '/\\');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal