Skip to content
PHP Ecosystem
Explore

HasHreflang

API reference › HTML Attribute › HasHreflang

traitUIAwesome\Html\Attribute\HasHreflang
Sourcesrc/HasHreflang.php
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.

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

Sets the hreflang attribute.

Declares the language of the linked resource.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullBCP 47 language tag, or null to remove the attribute.

Returns

static: New instance with the updated hreflang attribute.