| Sledge-Plugin-Paginate documentation | Contained in the Sledge-Plugin-Paginate distribution. |
Sledge::Plugin::Paginate - data paginate plugin for Sledge
This documentation refers to Sledge::Plugin::Paginate version 0.01
package Your::Pages;
use Sledge::Plugin::Paginate;
sub dispatch_index {
my $self = shift;
my @users = $self->user;
$self->paginate(
paging_num => $self->config->paging_num,
page_name => 'user',
data => \@users,
);
}
This paginate plugin can easily execute paging.
Atsushi Kobayashi, <nekokak at gmail.com>
Please report any bugs or feature requests to
bug-sledge-plugin-paginate at rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sledge-Plugin-Paginate.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Sledge::Plugin::Paginate
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Sledge-Plugin-Paginate
Copyright 2006 Atsushi Kobayashi, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Sledge-Plugin-Paginate documentation | Contained in the Sledge-Plugin-Paginate distribution. |
package Sledge::Plugin::Paginate; use warnings; use strict; our $VERSION = '0.01'; use Data::Page; our $REQUEST_PARAM = 'page'; sub import { my $self = shift; my $pkg = caller; no strict 'refs'; *{"$pkg\::paginate"} = sub { my ($self , %args) = @_; my $pager = Data::Page->new( scalar(@{$args{data}}), $args{paging_num}, $self->r->param($REQUEST_PARAM) || 0, ); $self->tmpl->param( $args{page_name} => [ $pager->splice($args{data}) ], pager => $pager, ); }; }
1; # End of Sledge::Plugin::Paginate