NAME
Data::Page::Set - Print page indexes
SYNOPSIS
use Data::Page;
use Data::Page::Set;
my @data = 0 .. 300;
my $page = Data::Page->new( scalar @data, 5, shift );
my $pageset = Data::Page::Set->new( $page, 6, {} );
print $pageset->generate;
DESCRIPTION
Data::Page::Set->new( $page, $setsize, $showhash );
Arguments
- $page [Required]
-
A Data::Page object.
- $setsize [Required]
-
The size of the pageset: If you have a page object with 20 pages, but you only want to show
<< < 4 5 6 7 8 > >>
Then setsize should be 5 because we're only showing 5 page indexes.
- $showhash
-
A hash with zero or more of the following keys, with a coderef as value:
- show_first
-
Executed when we want to print a link to the first page
- show_no_first
-
Executed when we don't want to print the first page
- show_prev
- show_no_prev
- show_next
- show_no_next
- show_last
- show_no_last
- show_page
- show_current_page
- joiner
-
Executed and used as the first argument to join
- grepper
-
Executed in grep { $code->($_) } before the result is joined
TODO
Improve joiner/grepper
Joiner and grepper could be replaced with one routine that constructs the return value.
Generic backend
Data::Page is atm the only pager supported, but we could do better than that.
AUTHOR
Berik Visschers <berikv@xs4all.nl>
COPYRIGHT
Copyright 2005 by Berik Visschers <berikv@xs4all.nl>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 205:
You forgot a '=back' before '=head1'