[TYPO3-mvc] Problems with widget.paginate ViewHelper

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Thu Sep 8 01:13:37 CEST 2011


Hello

I try to use the widget.paginate viewhelper.

I always get this error:
"PHP Catchable Fatal Error: Argument 1 passed to 
Tx_Fluid_ViewHelpers_Widget_PaginateViewHelper::render() must implement 
interface Tx_Extbase_Persistence_QueryResultInterface, instance of 
Tx_Extbase_Persistence_LazyObjectStorage given in 
/var/www/typo3_src-4.5.3/typo3/sysext/fluid/Classes/ViewHelpers/Widget/PaginateViewHelper.php 
line 76"

The action looks like this:
         public function 
galleryAction(Tx_Myextension_Domain_Model_Collection $collection) {
                 $this->view->assign('collection', $collection);
         }

old, working view was:

<f:for each="{collection.images}" as="image">
<div class="imageBox">
<div class="image">
<a class="clickEnlarge" rel="gallery" 
href="{settings.imageRootPath}{image.pfad}" title="{image.name}">
<f:image alt="{image.name}" height="160" width="240c"
                                                 
src="{settings.imageRootPath}{image.pfad}" />
</a>
</div>
<p class="caption">{image.name}</p>
</div>
</f:for>

new view with paginate:

<f:widget.paginate objects="{collection.images}" as="paginatedImages" 
configuration="{itemsPerPage: 6, insertAbove: 1, insertBelow: 1}">
<f:for each="{paginatedImages}" as="image">
<div class="imageBox">
<div class="image">
<a class="clickEnlarge" rel="gallery" 
href="{settings.imageRootPath}{image.pfad}" title="{image.name}">
<f:image alt="{image.name}" height="160" width="240c"
                                                 
src="{settings.imageRootPath}{image.pfad}" />
</a>
</div>
<p class="caption">{image.name}</p>
</div>
</f:for>
</f:widget.paginate>

what exactly should be assigned to the view?

thanks in advance


More information about the TYPO3-project-typo3v4mvc mailing list