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

Breadcrumb

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

function FilesystemLoader::getCacheKey

Overrides LoaderInterface::getCacheKey

1 method overrides FilesystemLoader::getCacheKey()
ThemeRegistryLoader::getCacheKey in core/lib/Drupal/Core/Template/Loader/ThemeRegistryLoader.php
Gets the cache key to use for the cache for a given template name.

File

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

Class

FilesystemLoader
Loads template from the filesystem.

Namespace

Twig\Loader

Code

public function getCacheKey(string $name) : string {
    if (null === ($path = $this->findTemplate($name))) {
        return '';
    }
    $len = \strlen($this->rootPath);
    if (0 === strncmp($this->rootPath, $path, $len)) {
        return substr($path, $len);
    }
    return $path;
}

API Navigation

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