CheckedStateInterface
API reference › HTML Contracts › Form › CheckedStateInterface
Implemented by 3 types
Defines the contract for form controls that expose the checked attribute.
Applies to checkbox and radio controls, where the supplied value is matched against the control value to resolve the checked state.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
checked() abstract | Sets the checked attribute. | CheckedStateInterface |
Method details
Section titled “Method details”checked()
Section titled “checked() ”abstract public function checked(mixed[]|bool|float|int|string|Stringable|UnitEnum|null $value): staticSets the checked attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | mixed[]|Stringable|UnitEnum| | Value matched against the control value to resolve the checked state, or null to remove the attribute. |
Returns
static: New instance with the updated checked attribute.