TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Fluid\ViewHelpers\Uri\ImageViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\Uri\ImageViewHelper:
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper Tx_Fluid_ViewHelpers_Uri_ImageViewHelper

Public Member Functions

 render ($src=NULL, $image=NULL, $width=NULL, $height=NULL, $minWidth=NULL, $minHeight=NULL, $maxWidth=NULL, $maxHeight=NULL, $treatIdAsReference=FALSE)
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 setArguments (array $arguments)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 isEscapingInterceptorEnabled ()
 
 setViewHelperNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
 
 setRenderChildrenClosure (\Closure $renderChildrenClosure)
 
 initializeArgumentsAndRender ()
 
 initialize ()
 
 renderChildren ()
 
 prepareArguments ()
 
 validateArguments ()
 
 initializeArguments ()
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
 resetState ()
 

Protected Attributes

 $imageService
 
- Protected Attributes inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 $arguments
 
 $templateVariableContainer
 
 $controllerContext
 
 $renderingContext
 
 $renderChildrenClosure = NULL
 
 $viewHelperVariableContainer
 
 $objectManager
 
 $escapingInterceptorEnabled = TRUE
 

Additional Inherited Members

- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Protected Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 registerArgument ($name, $type, $description, $required=FALSE, $defaultValue=NULL)
 
 overrideArgument ($name, $type, $description, $required=FALSE, $defaultValue=NULL)
 
 callRenderMethod ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 

Detailed Description

Resizes a given image (if required) and returns its relative path.

= Examples =

<f:uri.image src="EXT:myext/Resources/Public/typo3_logo.png" /> <output> typo3conf/ext/myext/Resources/Public/typo3_logo.png or (in BE mode): ../typo3conf/ext/myext/Resources/Public/typo3_logo.png </output>

<f:uri.image image="{imageObject}" /> <output> fileadmin/images/image.png or (in BE mode): fileadmin/images/image.png </output>

{f:uri.image(src: 'EXT:myext/Resources/Public/typo3_logo.png', minWidth: 30, maxWidth: 40)} <output> typo3temp/pics/[b4c0e7ed5c].png (depending on your TYPO3s encryption key) </output>

<f:uri.image src="NonExistingImage.png" /> <output> Could not get image resource for "NonExistingImage.png". </output>

Definition at line 59 of file ImageViewHelper.php.

Member Function Documentation

◆ render()

TYPO3\CMS\Fluid\ViewHelpers\Uri\ImageViewHelper::render (   $src = NULL,
  $image = NULL,
  $width = NULL,
  $height = NULL,
  $minWidth = NULL,
  $minHeight = NULL,
  $maxWidth = NULL,
  $maxHeight = NULL,
  $treatIdAsReference = FALSE 
)

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

See also
https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/ImgResource/
Parameters
string$src
FileInterface | AbstractFileFolder$image
string$widthwidth of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.
string$heightheight of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.
integer$minWidthminimum width of the image
integer$minHeightminimum height of the image
integer$maxWidthmaximum width of the image
integer$maxHeightmaximum height of the image
boolean$treatIdAsReferencegiven src argument is a sys_file_reference record
Exceptions

Definition at line 82 of file ImageViewHelper.php.

Member Data Documentation

◆ $imageService

TYPO3\CMS\Fluid\ViewHelpers\Uri\ImageViewHelper::$imageService
protected

Definition at line 64 of file ImageViewHelper.php.