Skip to content
PHP Ecosystem
Explore

SrcInterface

API reference › HTML Contracts › Attribute › SrcInterface

interfaceUIAwesome\Html\Contracts\Attribute\SrcInterface
Sourcesrc/Attribute/SrcInterface.php
Implemented by 8 types

Defines the contract for elements that expose the src attribute.

Applies to elements that embed an external resource, such as images, scripts, frames, and media sources.

MethodDescriptionDefined by
src() abstractSets the src attribute.SrcInterface
abstract public function src(string|Stringable|UnitEnum|null $value): static

Sets the src attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullURL of the embedded resource, or null to remove the attribute.

Returns

static: New instance with the updated src attribute.