function HelpTopicTwigLoader::__construct

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

Constructs a new HelpTopicTwigLoader object.

Parameters

string $root_path: The root path.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler service.

\Drupal\Core\Extension\ThemeHandlerInterface $theme_handler: The theme handler service.

File

core/modules/help/src/HelpTopicTwigLoader.php, line 44

Class

HelpTopicTwigLoader
Loads help topic Twig files from the filesystem.

Namespace

Drupal\help

Code

public function __construct($root_path, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler) {
    parent::__construct([], $root_path);
    // Add help_topics directories for modules and themes in the 'help_topic'
    // namespace, plus core.
    $this->addExtension($root_path . '/core');
    array_map([
        $this,
        'addExtension',
    ], $module_handler->getModuleDirectories());
    array_map([
        $this,
        'addExtension',
    ], $theme_handler->getThemeDirectories());
}

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