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

Breadcrumb

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

function FilesystemLoader::__construct

Same name in this branch
  1. 11.1.x core/lib/Drupal/Core/Template/Loader/FilesystemLoader.php \Drupal\Core\Template\Loader\FilesystemLoader::__construct()

Parameters

string|string[] $paths A path or an array of paths where to look for templates:

string|null $rootPath The root path common to all relative paths (null for getcwd()):

4 calls to FilesystemLoader::__construct()
FilesystemLoader::__construct in core/lib/Drupal/Core/Template/Loader/FilesystemLoader.php
Constructs a new FilesystemLoader object.
FilesystemLoader::__construct in core/lib/Drupal/Core/Template/Loader/FilesystemLoader.php
Constructs a new FilesystemLoader object.
HelpTopicTwigLoader::__construct in core/modules/help/src/HelpTopicTwigLoader.php
Constructs a new HelpTopicTwigLoader object.
HelpTopicTwigLoader::__construct in core/modules/help/src/HelpTopicTwigLoader.php
Constructs a new HelpTopicTwigLoader object.
3 methods override FilesystemLoader::__construct()
FilesystemLoader::__construct in core/lib/Drupal/Core/Template/Loader/FilesystemLoader.php
Constructs a new FilesystemLoader object.
HelpTopicTwigLoader::__construct in core/modules/help/src/HelpTopicTwigLoader.php
Constructs a new HelpTopicTwigLoader object.
ThemeRegistryLoader::__construct in core/lib/Drupal/Core/Template/Loader/ThemeRegistryLoader.php
Constructs a new ThemeRegistryLoader object.

File

vendor/twig/twig/src/Loader/FilesystemLoader.php, line 40

Class

FilesystemLoader
Loads template from the filesystem.

Namespace

Twig\Loader

Code

public function __construct($paths = [], ?string $rootPath = null) {
    $this->rootPath = ($rootPath ?? getcwd()) . \DIRECTORY_SEPARATOR;
    if (null !== $rootPath && false !== ($realPath = realpath($rootPath))) {
        $this->rootPath = $realPath . \DIRECTORY_SEPARATOR;
    }
    if ($paths) {
        $this->setPaths($paths);
    }
}

API Navigation

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