public function HookHelpSection::listTopics in Drupal 10
Same name and namespace in other branches
- 8 core/modules/help/src/Plugin/HelpSection/HookHelpSection.php \Drupal\help\Plugin\HelpSection\HookHelpSection::listTopics()
- 9 core/modules/help/src/Plugin/HelpSection/HookHelpSection.php \Drupal\help\Plugin\HelpSection\HookHelpSection::listTopics()
File
- core/
modules/ help/ src/ Plugin/ HelpSection/ HookHelpSection.php, line 60
Class
- HookHelpSection
- Provides the module topics list section for the help page.
Namespace
Drupal\help\Plugin\HelpSectionCode
public function listTopics() {
$topics = [];
$this->moduleHandler
->invokeAllWith('help', function (callable $hook, string $module) use (&$topics) {
$title = $this->moduleHandler
->getName($module);
$topics[$title] = Link::createFromRoute($title, 'help.page', [
'name' => $module,
]);
});
// Sort topics by title, which is the array key above.
ksort($topics);
return $topics;
}