-
-
02 May 2020 15:21:40 UTC
- Distribution: Data-Page-Navigation
- Module version: 0.07
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (285 / 0 / 0)
- Kwalitee
Bus factor: 1- 92.59% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (10.11KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 4 contributors- Masahiro Nagano <kazeburo {at} gmail.com>
-
Naoki Tomita
-
Takahiro Shimizu
-
Yuki Kimoto
NAME
Data::Page::Navigation - adds methods for page navigation link to Data::Page
SYNOPSIS
use Data::Page::Navigation; my $total_entries=180; my $entries_per_page = 10; my $pages_per_navigation = 10; my $current_page = 1; my $pager = Data::Page->new( $total_entries, $entries_per_page, $current_page ); $pager->pages_per_navigation($pages_per_navigation); @list = $pager->pages_in_navigation($pages_per_navigation); #@list = qw/1 2 3 4 5 6 7 8 9 10/; $pager->current_page(9); @list = $pager->pages_in_navigation($pages_per_navigation); #@list = qw/5 6 7 8 9 10 11 12 13 14/;
DESCRIPTION
Using this module instead of, or in addition to Data::Page, adds a few methods to Data::Page.
This modules allow you to get the array where page numbers of the number that you set are included. The array is made so that a current page may come to the center as much as possible in the array.
METHODS
pages_per_navigation
Setting the number of page numbers displayed on one page. default is 10
pages_in_navigation([pages_per_navigation])
This method returns an array (or array-ref in scalar context) where page numbers of the number that you set with pages_per_navigation are included.
first_navigation_page
Returns the first page in the list returned by pages_in_navigation().
last_navigation_page
Returns the last page in the list returned by pages_in_navigation().
SEE ALSO
AUTHOR
Masahiro Nagano <kazeburo {at} gmail.com>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Data::Page::Navigation, copy and paste the appropriate command in to your terminal.
cpanm Data::Page::Navigation
perl -MCPAN -e shell install Data::Page::Navigation
For more information on module installation, please visit the detailed CPAN module installation guide.