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

tokuhirom on 2006-11-05T15:32:34

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!