TopBarItemBase.php

Namespace

Drupal\navigation

File

core/modules/navigation/src/TopBarItemBase.php

View source
<?php

declare (strict_types=1);
namespace Drupal\navigation;

use Drupal\Component\Plugin\PluginBase;

/**
 * Base class for top bar item plugins.
 */
abstract class TopBarItemBase extends PluginBase implements TopBarItemPluginInterface {
    
    /**
     * {@inheritdoc}
     */
    public function label() : string|\Stringable {
        return $this->pluginDefinition['label'];
    }
    
    /**
     * {@inheritdoc}
     */
    public function region() : TopBarRegion {
        return $this->pluginDefinition['region'];
    }
    
    /**
     * {@inheritdoc}
     */
    public abstract function build() : array;

}

Classes

Title Deprecated Summary
TopBarItemBase Base class for top bar item plugins.

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