Skip to content

Instantly share code, notes, and snippets.

@phluzern
Last active December 23, 2015 06:39
Show Gist options
  • Save phluzern/6595553 to your computer and use it in GitHub Desktop.
Save phluzern/6595553 to your computer and use it in GitHub Desktop.
Using TYPO3.Media to render images in TYPO3 Flow
All the ViewHelper options are documented in:
/Packages/Application/TYPO3.Media/Classes/TYPO3/Media/ViewHelpers/ImageViewHelper.php
{namespace m=TYPO3\Media\ViewHelpers}
<f:if condition="{model.image}">
<m:image image="{model.image}" maximumHeight="72" alt="Profilbild" />
</f:if>
/**
* The user image
*
* @var \TYPO3\Media\Domain\Model\Image
* @ORM\OneToOne(cascade={"all"}, orphanRemoval=true)
*
*/
protected $image;
/**
* Adds an image to this user
*
* @param \TYPO3\Media\Domain\Model\Image $image
* @return void
*/
public function setImage(\TYPO3\Media\Domain\Model\Image $image) {
$this->image = $image;
}
/**
* Get the image
*
* @return \TYPO3\Media\Domain\Model\Image The image
*/
public function getImage() {
return $this->image;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment