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


Manual Reference Pages  -  TENG::PLUGIN::PAGER (3)

.ds Aq ’

NAME

Teng::Plugin::Pager - Pager

CONTENTS

SYNOPSIS



    package MyApp::DB;
    use parent qw/Teng/;
    __PACKAGE__->load_plugin(Pager);

    package main;
    my $db = MyApp::DB->new(dbh => $dbh);
    my $page = $c->req->param(page) || 1;
    my ($rows, $pager) = $db->search_with_pager(user => {type => 3}, {page => $page, rows => 5});



DESCRIPTION

This is a helper for pagination.

This pager fetches entries_per_page + 1 rows. And detect this page has a next page or not.

METHODS

my (\@rows, $pager) = $db->search_with_pager($table_name, \%where, \%opts) Select from database with pagination.

The arguments are mostly same as $db-search()>. But two additional options are available.
$opts->{page} Current page number.
$opts->{rows} The number of entries per page.

This method returns ArrayRef[Teng::Row] and instance of Data::Page::NoTotalEntries.

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


perl v5.20.3 TENG::PLUGIN::PAGER (3) 2016-04-03

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