Closed nics closed 10 years ago
Hi vitali,
it think it would be best to implement the pager as a Moo::Role
something like
package Catmandu::Paged;
requires 'total'; requires 'limit'; requires 'start';
sub current_page { …. }
sub next_page { …. }
http://cpansearch.perl.org/src/LBROCARD/Data-Page-2.02/lib/Data/Page.pm
has everything we need to steal ;-)
On 03 Sep 2013, at 08:55, Vitali Peil wrote:
Nicolas, I have some simple formulas for calculating pagination. But I don't know how to implement it.
This is the current sub. sub build_pager { my $self = $[0]; Data::SpreadPagination->new({ totalEntries => $self->total, entriesPerPage => $self->limit, startEntry => $self->start+1, maxPages => $self->max_pages_in_spread, }); }
How should the new sub look like? What kind of object(?)/stuff should it return.
— Reply to this email directly or view it on GitHub.
duplicates #32
Well, #32 is the pull request for this issue. So every pull request concerning an issue will be a duplicate.
Nicolas, I have some simple formulas for calculating pagination. But I don't know how to implement it.
This is the current sub. sub _buildpager { my $self = $[0]; Data::SpreadPagination->new({ totalEntries => $self->total, entriesPerPage => $self->limit, startEntry => $self->start+1, maxPages => $self->max_pages_in_spread, }); }
How should the new sub look like? What kind of object(?)/stuff should it return.