HasHreflang
API reference › HTML Attribute › HasHreflang
Used by 2 types
Provides an immutable API for the hreflang attribute.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link#hreflang.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
hreflang() | Sets the hreflang attribute. | HasHreflang |
Method details
Section titled “Method details”hreflang()
Section titled “hreflang() ”public function hreflang(string|Stringable|UnitEnum|null $value): staticSets the hreflang attribute.
Declares the language of the linked resource.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | BCP 47 language tag, or null to remove the attribute. |
Returns
static: New instance with the updated hreflang attribute.