function HelpTopicDiscovery::getDefinitions

Same name and namespace in other branches
  1. 9 core/modules/help_topics/src/HelpTopicDiscovery.php \Drupal\help_topics\HelpTopicDiscovery::getDefinitions()
  2. 8.9.x core/modules/help_topics/src/HelpTopicDiscovery.php \Drupal\help_topics\HelpTopicDiscovery::getDefinitions()
  3. 11.x core/modules/help/src/HelpTopicDiscovery.php \Drupal\help\HelpTopicDiscovery::getDefinitions()

Overrides DiscoveryTrait::getDefinitions

File

core/modules/help/src/HelpTopicDiscovery.php, line 58

Class

HelpTopicDiscovery
Discovers help topic plugins from Twig files in help_topics directories.

Namespace

Drupal\help

Code

public function getDefinitions() {
  $plugins = $this->findAll();
  // Flatten definitions into what's expected from plugins.
  $definitions = [];
  foreach ($plugins as $list) {
    foreach ($list as $id => $definition) {
      $definitions[$id] = $definition;
    }
  }
  return $definitions;
}

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