MediaViewHelper extends AbstractTagBasedViewHelper
This class is the implementation of a Fluid ViewHelper.
View this class in the TYPO3 ViewHelper reference: <f:media>
FinalYes
ViewHelper to render a given media file (audio/video/images) with the correct HTML tag.
It utilizes the RendererRegistry
to determine the correct Renderer class. When no
renderer can be resolved, it will fall back to use the default ImageViewHelper
for regular images.
<f:media file="{file}" width="400" height="375" />
Tags
Table of Contents
Properties
- $tagName : string
Methods
- initializeArguments() : void
- render() : string
- Render a given media file.
- getImageService() : ImageService
- renderImage() : string
- Render img tag
Properties
$tagName
protected
string
$tagName
= 'img'
Methods
initializeArguments()
public
initializeArguments() : void
render()
Render a given media file.
public
render() : string
Tags
Return values
stringgetImageService()
protected
getImageService() : ImageService
Return values
ImageServicerenderImage()
Render img tag
protected
renderImage(FileInterface $image, string $width, string $height, string|null $fileExtension) : string
Parameters
- $image : FileInterface
- $width : string
- $height : string
- $fileExtension : string|null
Return values
string —Rendered img tag