function TopBar::getInfo

Returns the element properties for this element.

Return value

array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format.

Overrides ElementInterface::getInfo

File

core/modules/navigation/src/Element/TopBar.php, line 21

Class

TopBar
Provides a render element for the default Drupal toolbar.

Namespace

Drupal\navigation\Element

Code

public function getInfo() : array {
  return [
    '#pre_render' => [
      [
        static::class,
        'preRenderTopBar',
      ],
    ],
    '#theme' => 'top_bar',
    '#attached' => [
      'library' => [
        'navigation/internal.navigation',
      ],
    ],
  ];
}

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