General

  eZ Systems Website
  Technical documentation
  Editor documentation

This Documentation contains:
 
Technical documentation:



⚠ WARNING ! This documentation is deprecated !

Please go to the current Technical Documentation

Skip to end of metadata
Go to start of metadata

Description

When listing content (e.g. blog posts), pagination is a very common use case and is usually painful to implement by hand.

For this purpose eZ Platform recommends the use of Pagerfanta library and proposes adapters for it.

Usage

my_template.html.twig

For more information and examples, have a look at PagerFanta documentation.

Adapters

Adapter class nameDescription
eZ\Publish\Core\Pagination\Pagerfanta\ContentSearchAdapter
Makes the search against passed Query and returns Content objects.
eZ\Publish\Core\Pagination\Pagerfanta\ContentSearchHitAdapter
Same as ContentSearchAdapter but returns instead SearchHit objects.
eZ\Publish\Core\Pagination\Pagerfanta\LocationSearchAdapter
Makes a Location search against passed Query and returns Location objects.
eZ\Publish\Core\Pagination\Pagerfanta\LocationSearchHitAdapter
Same as LocationSearchAdapter but returns instead SearchHit objects.

 

 

 

2 Comments

  1. `$query->criterion` is deprecated and should be replaced with `$query->query`.

  2. The example should make use of the `eZ\Publish\API\Repository\Values\Content\Query\SortClause` namespace to be a functioning example.