Skip to content
PHP Ecosystem
Explore

HasLang

API reference › HTML Attribute › Global › HasLang

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

Provides an immutable API for the lang attribute.

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

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

Sets the lang attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullLanguage tag, or null to remove the attribute.

Returns

static: New instance with the updated lang attribute. Language for predefined enum values.

Throws