ImageViewHelper extends AbstractTagBasedViewHelper
This class is the implementation of a Fluid ViewHelper.
View this class in the TYPO3 ViewHelper reference: <f:image>
Resizes a given image (if required) and renders the respective img tag.
External URLs are not processed. Only a given width and height will be set on the tag.
Examples
Default
::
<f:image src="EXT:myext/Resources/Public/typo3_logo.png" alt="alt text" />
Output in frontend::
or in backend::
Image Object
::
<f:image image="{imageObject}" />
Output::
Inline notation
::
{f:image(src: 'EXT:viewhelpertest/Resources/Public/typo3_logo.png', alt: 'alt text', minWidth: 30, maxWidth: 40)}
Output::
Depending on your TYPO3s encryption key.
Other resource type (e.g. PDF)
::
<f:image src="fileadmin/user_upload/example.pdf" alt="foo" />
If your graphics processing library is set up correctly then it will output a thumbnail of the first page of your PDF document:
<img src="fileadmin/_processed_/1/2/csm_example_aabbcc112233.gif" width="200" height="284" alt="foo">
Non-existent image
::
<f:image src="NonExistingImage.png" alt="foo" />
Could not get image resource for "NonExistingImage.png".
Table of Contents
Properties
- $imageService : ImageService
- $tagName : string
Methods
- __construct() : mixed
- initializeArguments() : mixed
- Initialize arguments.
- render() : string
- Resizes a given image (if required) and renders the respective img tag
Properties
$imageService
protected
ImageService
$imageService
$tagName
protected
string
$tagName
= 'img'
Methods
__construct()
public
__construct() : mixed
initializeArguments()
Initialize arguments.
public
initializeArguments() : mixed
render()
Resizes a given image (if required) and renders the respective img tag
public
render() : string
Tags
Return values
string —Rendered tag