Skip to content
PHP Ecosystem
Explore

ValueInterface

API reference › HTML Contracts › Attribute › ValueInterface

interfaceUIAwesome\Html\Contracts\Attribute\ValueInterface
Sourcesrc/Attribute/ValueInterface.php
Implemented by 21 types

Defines the contract for elements that expose a single-valued value attribute.

Applies to scalar-valued controls such as text inputs, hidden inputs, buttons, and options.

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

Sets the value attribute.

Parameters

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

Returns

static: New instance with the updated value attribute.