Skip to content
PHP Ecosystem
Explore

HasId

API reference › HTML Attribute › Global › HasId

traitUIAwesome\Html\Attribute\Global\HasId
Sourcesrc/Global/HasId.php
Used by 4 types

Provides an immutable API for the id attribute.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id.

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

Sets the id attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullElement identifier, or null to remove the attribute.

Returns

static: New instance with the updated id attribute.