function HelpTopicTwigLoader::findTemplate
Overrides FilesystemLoader::findTemplate
1 call to HelpTopicTwigLoader::findTemplate()
- HelpTopicTwigLoader::getSourceContext in core/
modules/ help/ src/ HelpTopicTwigLoader.php - Returns the source context for a given template logical name.
File
-
core/
modules/ help/ src/ HelpTopicTwigLoader.php, line 99
Class
- HelpTopicTwigLoader
- Loads help topic Twig files from the filesystem.
Namespace
Drupal\helpCode
protected function findTemplate($name, $throw = TRUE) {
if (!str_ends_with($name, '.html.twig')) {
if (!$throw) {
return NULL;
}
$extension = pathinfo($name, PATHINFO_EXTENSION);
throw new LoaderError(sprintf("Help topic %s has an invalid file extension (%s). Only help topics ending .html.twig are allowed.", $name, $extension));
}
return parent::findTemplate($name, $throw);
}