Aniki::Plugin::PagerInjector - plus one pager injector
package MyDB; use Mouse v2.4.5; extends qw/Aniki/; with qw/Aniki::Plugin::PagerInjector/; package main; my $db = MyDB->new(...); my ($page, $rows) = (1, 10); my ($limit, $offset) = ($rows + 1, ($page - 1) * $rows); my $result = $db->select('user', { type => 2 }, { limit => $limit, offset => $offset }); # => Aniki::Result::Collection $result = $db->inject_pager_to_result($result => { # => inject Aniki::Result::Role::Pager table_name => 'user', rows => $rows, page => $page, }) $result->pager; # => Data::Page::NoTotalEntries
perl Data::Page::NoTotalEntries
Copyright (C) karupanerura.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
karupanerura <karupa@cpan.org>
To install Aniki, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Aniki
CPAN shell
perl -MCPAN -e shell install Aniki
For more information on module installation, please visit the detailed CPAN module installation guide.