GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Data::Page::NoTotalEntries(3) User Contributed Perl Documentation Data::Page::NoTotalEntries(3)

Data::Page::NoTotalEntries - help when paging through sets of results without total entries

  use Data::Page::NoTotalEntries;

Data::Page::NoTotalEntries is a generic pager object, so it's very similar with Data::Page. But so Data::Page::NoTotalEntries doesn't support "$pager->total_entries" and other some methods.

In sometime, I don't want to count total entries, because counting total entries from database are very slow.

my $pager = Data::Page::NoTotalEntries->new(%args);
Create new instance of Data::Page::NoTotalEntries. You can initialize attributes at constructor with %args.
$pager->next_page()
This method returns the next page number, if one exists. Otherwise it returns undefined:

    if ($page->next_page) {
        print "Next page number: ", $page->next_page, "\n";
    }
    
$pager->previous_page()
This method returns the previous page number, if one exists. Otherwise it returns undefined:

    if ($page->previous_page) {
        print "Previous page number: ", $page->previous_page, "\n";
    }
    
$pager->prev_page()
This is a alias for "$pager->previous_page()"
$pager->first()
This method returns the number of the first entry on the current page.
$pager->last()
This method returns the number of the last entry on the current page.

has_next: Bool
Does this page has a next page?
entries_per_page: Int
The number of entries in each page.
current_page : Int
This attribute is the current page number:
entries_on_this_page: Int
This attribute is the number of entries on the current page

Tokuhiro Matsuno <tokuhirom AAJKLFJEF GMAIL COM>

Data::Page is a pager component but requires the number of total entries.

Copyright (C) Tokuhiro Matsuno

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2011-02-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.