class TopBarItemZero

Same name and namespace in other branches
  1. 11.x core/modules/navigation/tests/navigation_test/src/Plugin/TopBarItem/TopBarItemZero.php \Drupal\navigation_test\Plugin\TopBarItem\TopBarItemZero

Provides a top bar item plugin for testing the top bar item weight.

Attributes

#[TopBarItem(id: 'test_item_zero', region: TopBarRegion::Context, label: new TranslatableMarkup('Zero Weight'), weight: 0)]

Hierarchy

Expanded class hierarchy of TopBarItemZero

File

core/modules/navigation/tests/navigation_test/src/Plugin/TopBarItem/TopBarItemZero.php, line 15

Namespace

Drupal\navigation_test\Plugin\TopBarItem
View source
class TopBarItemZero extends TopBarItemBase {
  
  /**
   * {@inheritdoc}
   */
  public function build() : array {
    return [
      '#markup' => '<span class="top-bar__title" data-plugin-id="test_item_zero">Zero Weight</span>',
    ];
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
PluginBase::$configuration protected property Configuration information passed into the plugin.
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin ID.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function
PluginBase::getDerivativeId public function
PluginBase::getPluginDefinition public function
PluginBase::getPluginId public function
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object.
TopBarItemBase::label public function Returns the translated plugin label. Overrides TopBarItemPluginInterface::label
TopBarItemBase::region public function Returns the plugin region. Overrides TopBarItemPluginInterface::region
TopBarItemBase::weight public function Returns the plugin weight. Overrides TopBarItemPluginInterface::weight
TopBarItemZero::build public function Builds and returns the renderable array for this top bar item plugin. Overrides TopBarItemBase::build

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