Skip to content
PHP Ecosystem
Explore

HasValue

API reference › HTML Attribute › HasValue

traitUIAwesome\Html\Attribute\HasValue
Sourcesrc/HasValue.php
Used by 20 types

Provides an immutable API for the value attribute.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/value.

MethodDescriptionDefined by
value()Sets the value attribute.HasValue
public function value(bool|float|int|string|Stringable|UnitEnum|null $value): static

Sets the value attribute.

Defines the current value for the element.

Parameters

ParameterTypeDescription
$valuebool|float|int|string|Stringable|UnitEnum|nullElement value as bool, int, float, string, Stringable, UnitEnum, or null to remove the attribute.

Returns

static: New instance with the updated value attribute.