f:widget.paginate

This is a view helper for rendering a pagination of objects or arrays.

Properties

objects

Variable type
Object
Description
Objects or arrays used for pagination
Default value
NULL
Mandatory
Yes

as

Variable type
String
Description
The name of the variable which contains the paginated objects
Default value
Empty String
Mandatory
Yes

configuration

Variable type
Array
Description
Configuration of the pagination: itemsPerPage, insertAbove, insertBelow, maximumNumberOfLinks, addQueryStringMethod, section
Default value
itemsPerPage: 10, insertAbove: false, insertBelow: true, maximumNumberOfLinks: 99
Mandatory
No

Examples

Pagination of a blog with required arguments

<f:widget.paginate objects="{blogs}" as="paginatedBlogs">
   <f:for each="{paginatedBlogs}" as="blog">
      <h2>{blog.title}</h2>
      <p>{blog.text}</p>
   </f:for>
</f:widget.paginate>

Pagination of a blog with custom configuration

<f:widget.paginate objects="{blogs}" as="paginatedBlogs"
   configuration="{itemsPerPage: 5, insertAbove: 1, insertBelow: 0, maximumNumberOfLinks: 10}">
   <f:for each="{paginatedBlogs}" as="blog">
      <h2>{blog.title}</h2>
      <p>{blog.text}</p>
   </f:for>
</f:widget.paginate>