Skip to content
PHP Ecosystem
Explore

HasName

API reference › HTML Attribute › HasName

traitUIAwesome\Html\Attribute\HasName
Sourcesrc/HasName.php
Used by 10 types

Provides an immutable API for the name attribute.

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

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

Sets the name attribute.

Defines the metadata name or form control name.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullName value, or null to remove the attribute.

Returns

static: New instance with the updated name attribute. MetaName for predefined enum values.