Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

tokuhirom (7396)

tokuhirom
  (email not shown publicly)
http://d.hatena.ne.jp/tokuhirom/

Journal of tokuhirom (7396)

Sunday November 05, 2006
10:32 AM

I released Sledge::Plugin::Pager 0.01 on CPAN.

[ #31515 ]

I wrote the Sledge::Plugin::Pager.

I want easy to write the paging, because every index page needs
paginate, in prgmatic web application.

A normal paginate dispatcher code is:

sub dispatch_index {
  my $self = shift;
  $self->stash->{pager} = Your::Data::CD->pager(20, $self->r->param('page') || 1);
  $self->stash->{cds}   = $self->stash->{pager}->retrieve_all;
}

follow is equevalent code with Sledge::Plugin::Pager.

use Sledge::Plugin::Pager;
sub dispatch_index {
  my $self = shift;
  $self->pager('Your::Data::CD')->retrieve_all;
}

Yeah, happy paging!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.