Hi,
Every method on DBIx::Class where you want to pass additional options you do it after declaring an empty hashref... search({},{options...}).
Another thing..., I suggest you to doing thinks a lil' bit cleaner, less problems...
my $page = $q->param('page') || 1; my $rows = $q->param('rows') || 10; my $order_by = $q->param('order') || 'date DESC'; # And you should check, untaint the data, before using, # even an option like page= ... # Your code for getting the comments could be written as my $rs = $schema-> .... # and then while (my $comment = $rs->next) { ... } # this way, less memory is getting used by perl # Why not say my $pager = $rs->pager; # instead of this $rs->pager->...
Regards,
In reply to Re: DBIx::Class Pagination troubles
by fmerges
in thread DBIx::Class Pagination troubles
by stonecolddevin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |