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

Breadcrumb

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

function ChainLoader::isFresh

Overrides LoaderInterface::isFresh

File

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

Class

ChainLoader
Loads templates from other loaders.

Namespace

Twig\Loader

Code

public function isFresh(string $name, int $time) : bool {
    $exceptions = [];
    foreach ($this->getLoaders() as $loader) {
        if (!$loader->exists($name)) {
            continue;
        }
        try {
            return $loader->isFresh($name, $time);
        } 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