class TopBarItem
The top bar item attribute.
Attributes
#[\Attribute(\Attribute::TARGET_CLASS)]
Hierarchy
- class \Drupal\Component\Plugin\Attribute\AttributeBase implements \Drupal\Component\Plugin\Attribute\AttributeInterface
- class \Drupal\Component\Plugin\Attribute\Plugin extends \Drupal\Component\Plugin\Attribute\AttributeBase
- class \Drupal\navigation\Attribute\TopBarItem extends \Drupal\Component\Plugin\Attribute\Plugin
- class \Drupal\Component\Plugin\Attribute\Plugin extends \Drupal\Component\Plugin\Attribute\AttributeBase
Expanded class hierarchy of TopBarItem
8 files declare their use of TopBarItem
- PageActions.php in core/
modules/ navigation/ src/ Plugin/ TopBarItem/ PageActions.php - PageContext.php in core/
modules/ navigation/ src/ Plugin/ TopBarItem/ PageContext.php - TopBarItemHigh.php in core/
modules/ navigation/ tests/ navigation_test/ src/ Plugin/ TopBarItem/ TopBarItemHigh.php - TopBarItemInstantiation.php in core/
modules/ navigation/ tests/ navigation_test/ src/ Plugin/ TopBarItem/ TopBarItemInstantiation.php - TopBarItemLinkAttribute.php in core/
modules/ navigation/ tests/ navigation_test_top_bar/ src/ Plugin/ TopBarItem/ TopBarItemLinkAttribute.php
File
-
core/
modules/ navigation/ src/ Attribute/ TopBarItem.php, line 14
Namespace
Drupal\navigation\AttributeView source
final class TopBarItem extends Plugin {
/**
* Constructs a new TopBarItem instance.
*
* @param string $id
* The top bar item ID.
* @param \Drupal\navigation\TopBarRegion $region
* The region where the top bar item belongs to.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $label
* (optional) The human-readable name of the top bar item.
* @param class-string|null $deriver
* (optional) The deriver class.
* @param int $weight
* (optional) The weight of the top bar item.
*/
public function __construct(public readonly string $id, public readonly TopBarRegion $region, public readonly ?TranslatableMarkup $label = NULL, public readonly ?string $deriver = NULL, public readonly int $weight = 0) {
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
|---|---|---|---|---|---|
| AttributeBase::$class | protected | property | The class used for this attribute class. | ||
| AttributeBase::$dependencies | protected | property | The dependencies for the attribute class. | ||
| AttributeBase::$provider | protected | property | The provider of the attribute class. | ||
| AttributeBase::get | public | function | Gets the value of an attribute. | Overrides AttributeInterface::get | 7 |
| AttributeBase::getClass | public | function | Gets the class of the attribute class. | Overrides AttributeInterface::getClass | 1 |
| AttributeBase::getDependencies | public | function | Gets the dependencies for this attribute class. | Overrides AttributeInterface::getDependencies | |
| AttributeBase::getId | public | function | Gets the unique ID for this attribute class. | Overrides AttributeInterface::getId | |
| AttributeBase::getProvider | public | function | Gets the name of the provider of the attribute class. | Overrides AttributeInterface::getProvider | |
| AttributeBase::setClass | public | function | Sets the class of the attributed class. | Overrides AttributeInterface::setClass | 1 |
| AttributeBase::setDependencies | public | function | Sets the dependencies for this attribute class. | Overrides AttributeInterface::setDependencies | |
| AttributeBase::setProvider | public | function | Sets the name of the provider of the attribute class. | Overrides AttributeInterface::setProvider | |
| TopBarItem::__construct | public | function | Constructs a new TopBarItem instance. | Overrides Plugin::__construct |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.