paginate

Pagination of arrays

Params

  • array - Array to paginate
  • hash.by {Number} Number per page, required
  • returns {Object} Paginate object

Usage

{{#paginate array by=page_size}}
{{#each array as |item|}}
{{item}}
{{/each}}
{{/paginate}}

Example

{{#paginate collection.products by=5}}
{{#each collection.products as |product|}}
{{ product.title }}
{{/each}}
{{/paginate}}

Output
Silk Gown
Wool Coat
Velvet Dress
Linen Shirt
Silk Gown

paginate object

The paginate object can be accessed in the block context as paginate helper

Note: The paginate object is not available outside the block context. More detailed examples of Seed are available.

Was this article helpful to you?

Error loading component.

Error loading component.