Skip to content
PHP Ecosystem
Explore

HasLabel

API reference › HTML Attribute › HasLabel

traitUIAwesome\Html\Attribute\HasLabel
Sourcesrc/HasLabel.php
Used by 3 types

Provides an immutable API for the label attribute.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/option#label.

MethodDescriptionDefined by
label()Sets the label attribute.HasLabel
public function label(string|Stringable|UnitEnum|null $value): static

Sets the label attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullLabel text, or null to remove the attribute.

Returns

static: New instance with the updated label attribute.