ImageViewHelper
class ImageViewHelper extends AbstractTagBasedViewHelper (View source)
Renders an HTML tag from a given Neos.Media's image instance
= Examples =
<output>
(depending on the image, no scaling applied)
<img src="_Resources/Persistent/b29[...]95d.jpeg" width="120" height="180" alt="a sample image without scaling" />
</output>
<code title="Rendering an image with scaling at a given width only">
<neos.media:image image="{imageObject}" maximumWidth="80" alt="sample" />
<output>
(depending on the image; scaled down to a maximum width and height of 80 pixels, keeping the aspect ratio)
<img src="_Resources/Persistent/b29[...]95d.jpeg" width="53" height="80" alt="sample" />
</output>
<code title="Rendering an image with crop-scaling at given width and height">
<neos.media:image image="{imageObject}" maximumWidth="80" maximumHeight="80" allowCropping="true" alt="sample" />
<output>
(depending on the image; scaled up or down to a width 5000 pixels, keeping aspect ratio)
<img src="_Resources/Persistent/b29[...]95d.jpeg" width="80" height="80" alt="sample" />
</output>
Properties
protected ThumbnailService | $thumbnailService | ||
protected AssetService | $assetService | ||
protected string | $tagName | name of the tag to be created by this view helper |
Methods
void
initializeArguments()
No description
string
render()
Renders an HTML img tag with a thumbnail image, created from a given image.
Details
void
initializeArguments()
No description
string
render()
Renders an HTML img tag with a thumbnail image, created from a given image.