function TopBarItemManager::getRenderedTopBarItemsByRegion

Gets the top bar items prepared as render array.

Parameters

\Drupal\navigation\TopBarRegion $region: The region.

Return value

array An array of rendered top bar items, keyed by the plugin ID and sorted by weight.

Overrides TopBarItemManagerInterface::getRenderedTopBarItemsByRegion

File

core/modules/navigation/src/TopBarItemManager.php, line 36

Class

TopBarItemManager
Top bar item plugin manager.

Namespace

Drupal\navigation

Code

public function getRenderedTopBarItemsByRegion(TopBarRegion $region) : array {
  $instances = [];
  foreach ($this->getDefinitionsByRegion($region) as $plugin_id => $plugin_definition) {
    $instances[$plugin_id] = $this->createInstance($plugin_id)
      ->build();
  }
  return $instances;
}

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