function TopBar::getInfo

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 {
    $class = static::class;
    return [
        '#pre_render' => [
            [
                $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.