ImageViewHelper

final class \TYPO3\CMS\Fluid\ViewHelpers\Uri\ImageViewHelper

Extends
AbstractViewHelper

ViewHelper to resize, crop or convert a given image (if required) and return the URL to this processed file.

This ViewHelper works for images within FAL storages, as well as system resources shipped with an extension and referenced via an EXT:/PKG: identifier. A system resource has none of FAL's stored metadata (crop, title, ...), so it only ever uses this ViewHelper's own arguments for that.

For an extension resource that should not go through image processing at all, use <f:uri.resource> instead.

External URLs are not processed and just returned as is.

  <f:uri.image src="{variableWithFileadminLocation}" width="100c" />
  <f:uri.image src="EXT:myext/Resources/Public/typo3_logo.png" width="100c" />
  <f:uri.image image="{imageObject}" maxWidth="400" maxHeight="400" fileExtension="webp" />

Tags

see
https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-uri-image
see
https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-uri-resource

Table of Contents

Methods

__construct()  : mixed
initializeArguments()  : void
render()  : string
Resizes the image (if required) and returns its path. If the image was not resized, the path will be equal to $src

Methods

initializeArguments()

public initializeArguments() : void

render()

Resizes the image (if required) and returns its path. If the image was not resized, the path will be equal to $src

public render() : string

Return values

string
On this page