Last active
December 23, 2015 06:39
-
-
Save phluzern/6595553 to your computer and use it in GitHub Desktop.
Using TYPO3.Media to render images in TYPO3 Flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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