Skip to content
PHP Ecosystem
Explore

HasFor

API reference › HTML Attribute › HasFor

traitUIAwesome\Html\Attribute\HasFor
Sourcesrc/HasFor.php
Used by 1 type

Provides an immutable API for the for attribute.

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

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

Sets the for attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullSpace-separated list of related IDs, or null to remove the attribute.

Returns

static: New instance with the updated for attribute.