Skip to content
PHP Ecosystem
Explore

HasMedia

API reference › HTML Attribute › HasMedia

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

Provides an immutable API for the media attribute.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/media.

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

Sets the media attribute.

Specifies the media query for the linked resource.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullMedia query, or null to remove the attribute.

Returns

static: New instance with the updated media attribute.