Skip to main content

Image

Helper for rendering images


Properties

allowedOptions

protected static $allowedOptions
  • This property is static.

imagesClasses

protected $imagesClasses

Methods

__invoke

Generates a 'image' element

public __invoke(string $imageSrc, iterable $optionsAndAttributes = [], bool $escape = true): string

Parameters:

ParameterTypeDescription
$imageSrcstringThe path to the image
$optionsAndAttributesiterableImage options and Html attributes. Default : empty. Allowed options:
  • boolean fluid: responsive image
  • boolean thumbnail: thumbnail image
  • boolean rounded: rounded image
  • boolean figure: figure image
  • [srcset => type] sources: list of sources for <picture element> | | $escape | bool | True espace html content '$content'. Default True |

Return Value:

The image XHTML.

Throws:

  • InvalidArgumentException

renderSources

public renderSources(array $sources, bool $escape = true): string

Parameters:

ParameterTypeDescription
$sourcesarray
$escapebool