public function HelpTopicTwigLoader::__construct in Drupal 8
Same name and namespace in other branches
- 9 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 44
Class
- HelpTopicTwigLoader
- Loads help topic Twig files from the filesystem.
Namespace
Drupal\help_topicsCode
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());
}