Skip to content
PHP Ecosystem
Explore

HasSrc

API reference › HTML Attribute › HasSrc

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

Provides an immutable API for the src attribute.

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

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

Sets the src attribute.

Specifies the resource URL.

Parameters

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

Returns

static: New instance with the updated src attribute.