Simon Cozens > Maypole > templates/factory/pager

Download:
Maypole-1.7.tar.gz

Annotate this POD

CPAN RT

New  7
Open  5
View/Report Bugs
Source   Latest Release: Maypole-2.10

pager ^

This controls the pager display at the bottom (by default) of the list and search views. It expects a pager template argument which responds to the Data::Page interface.

#%] [% IF pager AND pager.first_page != pager.last_page; %]

<P ALIGN="center">Pages: [% SET begin_page = pager.current_page - 10; IF begin_page < 1; SET begin_page = pager.first_page; END; SET end_page = pager.current_page + 10; IF pager.last_page < end_page; SET end_page = pager.last_page; END; FOREACH num = [begin_page .. end_page]; IF num == pager.current_page; "["; num; "] "; ELSE; SET args = "?page=" _ num; # Order? SET label = "[" _ num _ "]"; link(classmetadata.table, "list", args, label); END; END; %] </P> [% END %]

syntax highlighting: