Dissolver v0.9.4 Dissolver.HTML View Source

An Html helper to render the pagination links,

Start by importing the Dissolver.HTML in your view module.

defmodule MyApp.ProductView do
  use MyApp.Web, :view
  import Dissolver.HTML
end

now you have the paginate/2 view helper in your template file.

<%= paginate @conn, @paginator %>

Where @page is a %Dissolver.Paginator{} struct returned from Dissolver.paginate/2.

paginate helper takes keyword list of options and params. <%= paginate @conn, @page, window: 5, next_label: ">>", previous_label: "<<", first: true, last: true, first_label: "First", last_label: "Last" %>

Link to this section Summary

Functions

Generates the HTML pagination links for a given page returned by Dissolver.

Link to this section Functions

Link to this function

paginate(paginator, route_helper, opts \\ [])

View Source

Generates the HTML pagination links for a given page returned by Dissolver.

Example:

iex> Dissolver.HTML.paginate(@conn, @dissolver)

Path can be overriden by adding setting :path in the opts. For example:

Dissolver.HTML.paginate(@conn, @dissolver, path: product_path(@conn, :index, foo: "bar"))

Additional panigation class can be added by adding setting :class in the opts. For example:

Dissolver.HTML.paginate(@conn, @dissolver, theme: :boostrap4, class: "paginate-sm")