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\LoaderCode
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) . ')' : ''));
}