class Image (View source)

Properties

protected bool|null $usePictureTag
protected Picture|Image|JavaScriptLazyImage $tag
protected Theme $theme

Methods

__construct(File $f = null, array|bool|null $options = null)

No description

getTag()

Returns an object that represents the HTML tag.

loadPictureSettingsFromTheme()

Load picture settings from the theme.

Details

__construct(File $f = null, array|bool|null $options = null)

No description

Parameters

File $f
array|bool|null $options

Use NULL to use the default options, a boolean (deprecated) to use a picture tag (TRUE) or an img tag (FALSE), or an array with these values:

  • bool|null `usePictureTag`: TRUE (use a `picture` tag), FALSE (use an `img` tag), NULL or not specified use the settings from the current page theme
  • bool|null `lazyLoadNative`: If TRUE the `loading="lazy"` attribute will be added to the `img`
  • bool|null `lazyLoadJavaScript`: If TRUE set the img `src` and/or source `srcset` image file path to `data-src` and/or `data-srcset`

Picture|Image|JavaScriptLazyImage getTag()

Returns an object that represents the HTML tag.

protected loadPictureSettingsFromTheme()

Load picture settings from the theme.

If the theme uses responsive image maps, the getTag method will return a Picture object.