function HookHelpSection::listTopics

Same name in other branches
  1. 9 core/modules/help/src/Plugin/HelpSection/HookHelpSection.php \Drupal\help\Plugin\HelpSection\HookHelpSection::listTopics()
  2. 8.9.x core/modules/help/src/Plugin/HelpSection/HookHelpSection.php \Drupal\help\Plugin\HelpSection\HookHelpSection::listTopics()
  3. 10 core/modules/help/src/Plugin/HelpSection/HookHelpSection.php \Drupal\help\Plugin\HelpSection\HookHelpSection::listTopics()

Overrides HelpSectionPluginInterface::listTopics

File

core/modules/help/src/Plugin/HelpSection/HookHelpSection.php, line 71

Class

HookHelpSection
Provides the module topics list section for the help page.

Namespace

Drupal\help\Plugin\HelpSection

Code

public function listTopics() {
    $topics = [];
    $this->moduleHandler
        ->invokeAllWith('help', function (callable $hook, string $module) use (&$topics) {
        $title = $this->moduleExtensionList
            ->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;
}

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