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

Breadcrumb

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

function ChainLoader::getCacheKey

Overrides LoaderInterface::getCacheKey

File

vendor/twig/twig/src/Loader/ChainLoader.php, line 95

Class

ChainLoader
Loads templates from other loaders.

Namespace

Twig\Loader

Code

public function getCacheKey(string $name) : string {
    $exceptions = [];
    foreach ($this->getLoaders() as $loader) {
        if (!$loader->exists($name)) {
            continue;
        }
        try {
            return $loader->getCacheKey($name);
        } catch (LoaderError $e) {
            $exceptions[] = \get_class($loader) . ': ' . $e->getMessage();
        }
    }
    throw new LoaderError(\sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' (' . implode(', ', $exceptions) . ')' : ''));
}
RSS feed
Powered by Drupal