[TYPO3-mvc] extbase way of accessing folder based file collection

Domi djgarms at gmail.com
Wed Jun 19 03:20:26 CEST 2013


Hi Frans
> /**  * fileCollectionRepository
>   *
>   * @var \TYPO3\CMS\Core\Resource\FileCollectionRepository
> * @inject */ protected $fileCollectionRepository;
>
> /** * Show album thumbs
> * * @param \MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum $mediaAlbum
> * @param int $page the page number * @return void */
> public function
> showAction(\MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum $mediaAlbum,
> $page = 1) {
>
> /** @var $fileCollection
> \TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection */
> $fileCollection =
> $this->fileCollectionRepository->findByUid($mediaAlbum->getUid());
> $fileCollection->loadContents();
>

I tried it, but it doesn't work. Is there any problem if the 
FileCollection gets accessed through a ViewHelper?

I do the same in my gallery:

inject FileCollectionRepository

findByUid($uid)

loadContents() --> empty!

Thats my problem right here, I was checking on the media_gallery but the 
only problem is, that I use a ViewHelper for it, everything else is the 
same.

Is there any additional typoscript setup necessary?

I will try moving all to the Controller itself.

Thanks,
Dominic


More information about the TYPO3-project-typo3v4mvc mailing list