ImageAsset
class ImageAsset implements Asset, HtmlRenderable
Image asset.
Properties
$width | |||
$height | |||
$mimeType |
Methods
__construct(string $url, string|null $file = null, int|null $width = null, int|null $height = null, string|null $mimeType = null, string|null $alternative = null, bool $lazyLoad = false, int $density = 1, string|bool|null $crossorigin = null)
No description
string
__toString()
Allows direct echoing of the object to get the URL.
Html
getImportElement()
Returns HTML tag name and attributes for rendering the asset.
Html
getPreloadElement()
Returns HTML tag name and attributes for preloading the asset.
Details
at line 23
__construct(string $url, string|null $file = null, int|null $width = null, int|null $height = null, string|null $mimeType = null, string|null $alternative = null, bool $lazyLoad = false, int $density = 1, string|bool|null $crossorigin = null)
No description
at line 39
string
__toString()
Allows direct echoing of the object to get the URL.
at line 65
Html
getImportElement()
Returns HTML tag name and attributes for rendering the asset.
at line 78
Html
getPreloadElement()
Returns HTML tag name and attributes for preloading the asset.
Traits
Lazy-loading of properties as a workaround for PHP < 8.4.