[Catalyst] DBIx::Class/TT Pager Question

Kay Sindre Bærulfsen berulfsen at gmail.com
Mon Jan 1 15:15:00 GMT 2007


On 12/29/06, Dennis Daupert <ddaupert at sbcglobal.net> wrote:
> I'm having a bit of a go of getting all the bits in place to do paging.

What I do;

Controller;

$c->stash->{'images'} = $c->model('DB::Image')->search({
    deleted => { LIKE => '0000-00-00 00:00:00' },
    gallery_id => $gallery->id,
},{
    rows => 6,
})->page($page);

View(TT);

[%- WHILE (i=images.next) %]
<img src="http://galleri.my-domain.nu/data/240x180/[%
i.filename.split('').first %]/[% i.filename FILTER upper %]?[%
i.updated %]" />
[% END %]

within the images-object, I have access to the pager-object like this;

images.pager.previous_page, images.pager.current_page,
images.pager.next_page or images.pager.last_page...

Good luck :)
-- 
Kay Bærulfsen



More information about the Catalyst mailing list