[TYPO3-dev] FAL image path in Extbase Controller

Frans Saris franssaris at gmail.com
Sat Mar 29 18:44:55 CET 2014


Hi Klaus,

This works all out of the box.

The phpdoc headers of your model doesn't seem to be correct.
The return of getImage should be the same type as $image.

Be aware that a FileReference isn't the the real file but a reference to
the file. And the extbase models are just wrappers around the core File and
FileReference models.

So if the image works in fluid try this
$myObject->getImage()->getOriginalRecource()->getPublicUrl()

Gr. Frans
Op 29 mrt. 2014 17:58 schreef "Klaus Heuer" <post at heuer-illustration.de>:

> Hi List,
>
> I need the whole image path in an Extbase Controller (background: I have
> to set headerdata, example: og image tag)
>
> Model:
>    /**
>      * Image
>      * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
>      */
>     protected $image;
>
>  /**
>      * Returns the image
>      *
>      * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\
> TYPO3\CMS\Extbase\Domain\Model\FileReference> $image
>      */
>     public function getImage() {
>         return $this->image;
>     }
>
> This works in Fluid well, but how to received the image path in Extbase?
> $myObject->getImage() didn't work.
>
> Is there a 'build in solution' or must I build my own query with mapped
> tables?
>
> Thanks for any hints.
>
> Klaus
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>



More information about the TYPO3-dev mailing list