[Solar-talk] pager + controller + model + view

Jeff Surgeson solar at 3hex.com
Wed Jul 4 14:47:32 CDT 2007


On Wednesday 04 July 2007 19:52, Rodrigo Moraes wrote:
> 2007/7/3, Jeff Surgeson:
> > In my controller....
> > // Set the pager info using the defaults.
> > $this->_setPager();
> >
> > // set up fetch query, build where clause,
> > // set order page and paging
> > $params = array(
> >         'where'         => $where,
> >         'order'         => $order,
> >         'page'          => $this->layout_pager['page'],
> >         'paging'        => $this->layout_pager['paging'],
> > );
> >
> > // get count of pages
> > $total = $this->_products->countPages($params);
> > $this->layout_pager['count'] = $total['count'];
>
> And now seeing that you are using an array for the pager data in your
> controller, I'm thinking seriously to make the pager helper receive an
> array with pager specs.
>
> It would be possible to make it work with 'pages' or 'count'; the
> later would be preferable but if 'pages' was passed we could guess the
> items count more or less. Also it would be very simple to output the
> pager: echo $this->pager()->fetch($href, $this->layout_pager). What do
> you think?

I think I like it, go for it and I will try and break it :-)

By the way did you ever finish the tiposPager() wrapper? if so could I look at 
it? or am I being forward :-(
-- 
...........::::::...........
Jeff Surgeson / South Africa


More information about the Solar-talk mailing list