HasLang
API reference › HTML Attribute › Global › HasLang
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.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
lang() | Sets the lang attribute. | HasLang |
Method details
Section titled “Method details”lang()
Section titled “lang() ”public function lang(string|Stringable|UnitEnum|null $value): staticSets the lang attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Language tag, or null to remove the attribute. |
Returns
static: New instance with the updated lang attribute. Language for predefined enum values.
Throws
InvalidArgumentException: If the value is not valid.