TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
ImageViewHelper Class Reference
Inheritance diagram for ImageViewHelper:
AbstractTagBasedViewHelper AbstractViewHelper

Public Member Functions

 initializeArguments ()
 
 render ()
 
- Public Member Functions inherited from AbstractTagBasedViewHelper
 __construct ()
 
 initializeArguments ()
 
 initialize ()
 
- Public Member Functions inherited from AbstractViewHelper
 setRenderingContext (\TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 prepareArguments ()
 

Protected Member Functions

 getImageUri ($src)
 
- Protected Member Functions inherited from AbstractTagBasedViewHelper
 registerTagAttribute ($name, $type, $description, $required=false, $default=null)
 
 registerUniversalTagAttributes ()
 
- Protected Member Functions inherited from AbstractViewHelper
 callRenderMethod ()
 
 getLogger ()
 
 registerRenderMethodArguments ()
 

Protected Attributes

 $tagName = 'img'
 
- Protected Attributes inherited from AbstractTagBasedViewHelper
 $tagName = 'div'
 
 $tag
 
 $escapeOutput = false
 
- Protected Attributes inherited from AbstractViewHelper
 $controllerContext
 
 $objectManager
 

Detailed Description

Render an img tag for given image src. If $src doesn't exist and $fallbackImage is given check if that file exists and render img tag.

If no existing file is found no tag is rendered.

= Examples =

<em:image src="EXT:myext/Resources/Public/typo3_logo.png" alt="alt text" /> <output>

alt text

</output>

<f:image src="NonExistingImage.png" alt="foo" /> <output> </output>

Definition at line 42 of file extensionmanager/Classes/ViewHelpers/ImageViewHelper.php.

Member Function Documentation

getImageUri (   $src)
protected

Get image uri

Parameters
string$src
Returns
string

Definition at line 102 of file extensionmanager/Classes/ViewHelpers/ImageViewHelper.php.

References GeneralUtility\getFileAbsFileName(), and PathUtility\stripPathSitePrefix().

Referenced by ImageViewHelper\render().

render ( )

Resizes a given image (if required) and renders the respective img tag

Returns
string rendered tag.

Definition at line 68 of file extensionmanager/Classes/ViewHelpers/ImageViewHelper.php.

References ImageViewHelper\getImageUri().

Member Data Documentation

$tagName = 'img'
protected