function HelpTopicTwigLoader::addExtension

Same name and namespace in other branches
  1. 8.9.x core/modules/help_topics/src/HelpTopicTwigLoader.php \Drupal\help_topics\HelpTopicTwigLoader::addExtension()
  2. 10 core/modules/help/src/HelpTopicTwigLoader.php \Drupal\help\HelpTopicTwigLoader::addExtension()
  3. 11.x core/modules/help/src/HelpTopicTwigLoader.php \Drupal\help\HelpTopicTwigLoader::addExtension()

Adds an extensions help_topics directory to the Twig loader.

Parameters

$path: The path to the extension.

1 call to HelpTopicTwigLoader::addExtension()
HelpTopicTwigLoader::__construct in core/modules/help_topics/src/HelpTopicTwigLoader.php
Constructs a new HelpTopicTwigLoader object.

File

core/modules/help_topics/src/HelpTopicTwigLoader.php, line 61

Class

HelpTopicTwigLoader
Loads help topic Twig files from the filesystem.

Namespace

Drupal\help_topics

Code

protected function addExtension($path) {
    $path .= DIRECTORY_SEPARATOR . 'help_topics';
    if (is_dir($path)) {
        $this->cache = $this->errorCache = [];
        $this->paths[self::MAIN_NAMESPACE][] = rtrim($path, '/\\');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.