function TopBarItem::__construct
Same name and namespace in other branches
- 11.x core/modules/navigation/src/Attribute/TopBarItem.php \Drupal\navigation\Attribute\TopBarItem::__construct()
Constructs a new TopBarItem instance.
Parameters
string $id: The top bar item ID.
\Drupal\navigation\TopBarRegion $region: The region where the top bar item belongs to.
\Drupal\Core\StringTranslation\TranslatableMarkup|null $label: (optional) The human-readable name of the top bar item.
class-string|null $deriver: (optional) The deriver class.
int $weight: (optional) The weight of the top bar item.
Overrides Plugin::__construct
File
-
core/
modules/ navigation/ src/ Attribute/ TopBarItem.php, line 31
Class
- TopBarItem
- The top bar item attribute.
Namespace
Drupal\navigation\AttributeCode
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) {
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.