Data::Page::Balanced

A data pager that will balance the number of entries per page
Download

Data::Page::Balanced Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Kim Ahlstr?m
  • Publisher web site:
  • http://search.cpan.org/~kimahl/

Data::Page::Balanced Tags


Data::Page::Balanced Description

A data pager that will balance the number of entries per page Data::Page::Balanced is a Perl module that behaves like Data::Page except that it balances the number of entries per page so there is no last page with only a few entries. If, for example, you have 26 entries and want 25 entries per page, a normal pager would give you two pages with 25 entries on the first and 1 on the last. Data::Page::Balanced will instead give you one page with 26 entries.The benefit of a balanced number of entries per page is greater when the number of pages is small, with the ideal case being when there are two pages with only one entry on the last, in which case Data::Page::Balanced will fold it over to the first page. This saves the user from having to navigate to a page with only one entry, making it easier for him or her to see all the entries at once.The default flexibility is floor(entries_per_page/2), which means that in the example with 25 entries per page, the calculated entries per page can go up to 37 (25 + 12). The flexibility can be changed both at initialization and later on.SYNOPSIS use Data::Page::Balanced; my $pager = Data::Page::Balanced->new({ total_entries => 67, entries_per_page => 25 }); print $pager->last_page() # 2 print $pager->entries_per_page() # 34 Requirements: · Perl


Data::Page::Balanced Related Software