Skip to content
PHP Ecosystem
Explore

HasAs

traitUIAwesome\Html\Attribute\HasAs
Sourcesrc/HasAs.php
Used by 1 type

Provides an immutable API for the as attribute.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link#as.

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

Sets the as attribute.

Identifies the resource type for preload and modulepreload links.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullResource type token, or null to remove the attribute.

Returns

static: New instance with the updated as attribute. AsValue for predefined enum values.

Throws