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