SrcInterface
API reference › HTML Contracts › Attribute › SrcInterface
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.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
src() abstract | Sets the src attribute. | SrcInterface |
Method details
Section titled “Method details”src()
Section titled “src() ”abstract public function src(string|Stringable|UnitEnum|null $value): staticSets the src attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | URL of the embedded resource, or null to remove the attribute. |
Returns
static: New instance with the updated src attribute.