Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HelpTopicTwigLoader.php

function 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.

Overrides FilesystemLoader::__construct

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal