Linux SoftwareProgrammingLibrariesTemplate::Plugin::Page 0.10

Template::Plugin::Page 0.10


Template::Plugin::Page is a plugin to help when paging through sets of results. SYNOPSIS [% USE page = Page($total_entries, $
Developer:   Leon Brocard
      more software by author →
Price:  0.00
License:   Perl Artistic License
File size:   3K
Language:   
OS:   
Rating:   0 /5 (0 votes)
Your vote:  
enlarge screenshot


Template::Plugin::Page is a plugin to help when paging through sets of results.

SYNOPSIS

[% USE page = Page($total_entries, $entries_per_page, $current_page) %]

First page: [% page.first_page %]
Last page: [% page.last_page %]
First entry on page: [% page.first %]
Last entry on page: [% page.last %]

When searching through large amounts of data, it is often the case that a result set is returned that is larger than we want to display on one page. This results in wanting to page through various pages of data. The maths behind this is unfortunately fiddly, hence this module.

The main concept is that you pass in the number of total entries, the number of entries per page, and the current page number. You can then call methods to find out how many pages of information there are, and what number the first and last entries on the current page really are.

It would be typically used in the following way for an HTML template:

[% USE page = Page(134, 10, 13) %]
Matches < b >[% page.first %] - [% page.last %]< /b > of
< b >[% page.total_entries %]< /b > records.< BR >

Page < b >[% page.current_page %]< /b > of
< b >[% page.last_page %]< /b >< BR >

[% IF page.previous_page %]
< a href="index.cgi?page=[% page.previous_page %]" >Previous< /a >
[% END %]   

[% IF page.next_page %]
< a href="index.cgi?page=[% page.next_page %]" > Next< /a >
[% END %]

... which would output something like:

Matches < b >121 - 130< /b > of
< b >134< /b > records.< BR >

Page < b >13< /b > of
< b >14< /b> < BR >

< a href="index.cgi?page=12" >Previous< /a >
   

< a href="index.cgi?page=14" >Next< /a >

Note that this module is simply a plugin to the Data::Page module.

Requirements:
  • Perl
    tags href index  index cgi  cgi page  nbsp nbsp  current page  page last  total entries  page first  last page  next page  entries per  page total  page page  

    Download Template::Plugin::Page 0.10


     http://ftp.casaafacerilor.ro/mirrors/CPAN/authors/id/L/LB/LBROCARD/Template-Plugin-Page-0.10.tar.gz


    Authors software

    PBS::GraphViz 0.35 (by Leon Brocard)

    Image::WorldMap 0.14 (by Leon Brocard)
    Image::WorldMap is a Perl module to create graphical world maps of data.

    SYNOPSIS

    use Image::WorldMap;
    my $map = Image::Wo

    Data::Page 2.00 (by Leon Brocard)
    Data::Page is a Perl module that helps when paging through sets of results.

    SYNOPSIS

    use Data::Page;

    my $page = Data::Pa

    Template::Plugin::Page 0.10 (by Leon Brocard)
    Template::Plugin::Page is a plugin to help when paging through sets of results.

    SYNOPSIS

    [% USE page = Page($total_entries, $

    MP3::ID3Lib 0.12 (by Leon Brocard)
    MP3::ID3Lib is a Perl module for ID3v1/ID3v2 Tagging of MP3 files.

    SYNOPSIS

    use MP3::ID3Lib;
    my $id3 = MP3::ID3Lib->new($f


    Similar software

    Template::Plugin::Page 0.10 (by Leon Brocard)
    Template::Plugin::Page is a plugin to help when paging through sets of results.

    SYNOPSIS

    [% USE page = Page($total_entries, $

    Data::Page 2.00 (by Leon Brocard)
    Data::Page is a Perl module that helps when paging through sets of results.

    SYNOPSIS

    use Data::Page;

    my $page = Data::Pa

    Template::Plugin::Pagination 0.90 (by Tony Bowden)
    Template::Plugin::Pagination is a plugin to help paginate pages of results.

    SYNOPSIS

    [% USE page = Pagination(items, current_

    Web Secretary 1.9.0 (by Baruch Even)
    Web Secretary is a web page monitoring software

    Data::Page::Viewport 1.02 (by Ron Savage)
    Data::Page::Viewport is a Perl module to scroll thru data a page, or just an item, at a time.

    Synopsis

    This is a complete, test

    WWW::Patent::Page::Response 0.07 (by Wanda B. Anon)
    WWW::Patent::Page::Response is an object holding a patent page or document (e.g

    Page Curl 0.5 (by Federico Mena-Quintero)

    AutoSlideshow 0.1.3.1 (by Georg Zimmermann)
    AutoSlideshow is a Firefox extension that shows a slideshow of all images of a page.

    AutoSlideshow allows you to view slideshows o

    History links 1.3 (by Vladimir Kudryavtsev)
    This class can be used to keep track of the pages navigated by a user, so it can generate back or next links providing a similar effe

    NewTabURL 1.1.3 (by Sogame)


    Other software in this category

    zlib 1.2.3 (by Jean-loup Gailly)
    zlib is designed to be a free, general-purpose, legally unencumbered, lossless data-compression library for use on virtually any comp

    libjpeg v6b (by Independent JPEG Group)
    libjpeg is a library for handling the JPEG (JFIF) image format

    OpenSSL 0.9.7c (by The OpenSSL Project Team)
    The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implement

    libxml2 2.6.27 (by DV)
    Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), libxml2 library i

    GNU C library 2.4 (by Andreas Jaeger)
    GNU C library (glibc) is one of the most important components of GNU Hurd and most modern Linux distributions.

    GNU C library is us

  •     search


    Featured Software

    jEdit 4.3 pre8
    jEdit is an Open Source text editor written in Java

    Opera 9.02
    Surf the Internet in a safer, faster, and easier way with Opera browser

    GNU Aspell 0.60.4
    GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell


    Subscribe in Rojo
    Google Reader
    Add to My Yahoo!

    Add to My AOL
    Subscribe with Bloglines
    Subscribe in NewsGator Online
    Add 'nixbit linux software' to Newsburst from CNET News.com
    del.icio.us nixbit linux software


    Top tags