You are here

public function HelpTopicTwigLoader::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/help_topics/src/HelpTopicTwigLoader.php \Drupal\help_topics\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_topics/src/HelpTopicTwigLoader.php, line 46

Class

HelpTopicTwigLoader
Loads help topic Twig files from the filesystem.

Namespace

Drupal\help_topics

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());
}