Koha::REST::Plugin::Pagination
$c->add_pagination_headers(); $c->add_pagination_headers( { base_total => $base_total, page => $page, per_page => $per_page, query_params => $query_params, total => $total, } );
Adds RFC5988 compliant Link headers for pagination to the response message carried by our controller.
Additionally, it also adds the customer X-Total-Count header containing the total results count, and X-Base-Total-Count header containing the total of the non-filtered results count.
Optionally accepts the any of the following parameters to override the values stored in the stash by the search_rs helper.
Total records for the search domain (e.g. all patron records, filtered only by visibility)
The requested page number, usually extracted from the request query. See objects.search_rs for more information.
The requested maximum results per page, usually extracted from the request query. See objects.search_rs for more information.
The request query, usually extracted from the request query and used to build the Link headers. See objects.search_rs for more information.
Total records for the search with filters applied.
$filter = $c->dbic_merge_pagination({ filter => $filter, params => { page => $params->{_page}, per_page => $params->{_per_page} } });
Adds page and rows elements to the filter parameter.
my $link = _build_link( $c, { page => 1, per_page => 5, rel => 'prev' });
Returns a string, suitable for using in Link headers following RFC5988.