Scroll to navigation

Catmandu::Paged(3pm) User Contributed Perl Documentation Catmandu::Paged(3pm)
 

NAME

Catmandu::Pages - Adds page calculation to a package

SYNOPSIS

    package MyPackage;
    use Moo;
    with 'Catmandu::Pages';
    sub start {
        12; # Starting result
    }
    sub limit  {
        10; # Number of results per page
    }
    sub total {
        131237128371; # Total number of results;
    }
    package main;
    my $x = MyPackage->new;
    $x->first_page;
    $x->last_page;
    $x->page_size;
    $x->page; # current page
    $x->previous_page;
    $x->next_page;
    $x->first_on_page;
    $x->next;
    $x->page_ranges;
    $x->pages_in_spread;

SEE ALSO

Catmandu::Hits
2014-10-14 perl v5.20.1