class ImageElement implements ElementContract

Properties

protected string $url

The URL of the image to be displayed.

protected string|null $altText

A plain-text summary of the image. This should not contain any markup.

Methods

__construct(string $url, string|null $altText = null)

Create a new image element instance.

alt(string $altText)

Set the alt text for the image.

array
toArray()

Get the instance as an array.

Details

at line 25
__construct(string $url, string|null $altText = null)

Create a new image element instance.

Parameters

string $url
string|null $altText

at line 34
ImageElement alt(string $altText)

Set the alt text for the image.

Parameters

string $altText

Return Value

ImageElement

at line 44
array toArray()

Get the instance as an array.

Return Value

array