Data::Scroller

Handle navigation of data over multiple pages in a 'rolling' pageset fashion, similar to that of Google
Download

Data::Scroller Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Benjamin Hare
  • Publisher web site:
  • http://search.cpan.org/~benh/

Data::Scroller Tags


Data::Scroller Description

Handle navigation of data over multiple pages in a 'rolling' pageset fashion, similar to that of Google Data::Scroller is an alternative to Data::Page by Leon Brocard.SYNOPSISIn Perl module my $s = Data::Scroller- >new( max_value = > $max_value, selected = > $selected, increment = > $increment, ); my $page_params = $s- >display;OR my $page_params = Data::Scroller- >new( max_value = > $max_value, selected = > $selected, increment = > $increment, )- >display;You would then make the $page_params hashref returned via the display method available for use within your templating system.For example if you were in a Catalyst based application: $c- >stash- >{page_params} = $page_params;You also want the current 'increment' value available in your templates, so for example you could display/change the number of pages displayed per page via your template. $c- >stash- >{page_increment} = $s- >increment;Note: when using this module within the Catalyst framework, say for the 'page' attribute of a search, setting that attribute to 'selected' ( the currently selected page ) will not work as you expect. This is because this module expects 'selected' to be relevant to the database row you want whereas the catalyst 'page' attribute expects it to be the display page number. A work around for this problem is as such:my $catalyst_attributes = { page = > $selected == 0 ? $selected : int(($selected / 10) + 1), };In TemplateHere is an example of how to set up paging in your templates assuming Template::Toolkit and Catalyst: « first< /a > « prev< /a > < /span > < /a > next »< /a > last »< /a > As you can see, you can simply add any additional parameters you wish to the paging links via your template. Requirements: · Perl


Data::Scroller Related Software