Zend Framework Pagination reloaded
UPDATE
A new version of this component is available.
I have a new version of my pagination component which solve the issue previously pointed out by Guy. This update comes along with a subclassed version of Zend_Db_Table which allows counting and specific columns selection respectively via the fetchCount() and fetchCols() methods. Btw, the fetchCols() method is very hackish at the moment, and I'll certainly end up with rewriting it using a plain Zend_Db_Select statement.
As always, any comment is appreciated. I'm thinking of subclassing the Rowset class to fill it with pagination info getters like getPageCount(), getNextPage(), etc, like in Symfony for those knowing, instead of relying on a getPaginationInfo() method. Future improvements will also include more view helper magic.
Also, I came up with a small new Riskle_Pattern namespace which I use to implement commonly used patterns, such as the Proxy Pattern. I'm not yet sure of the pertinence of this thing, so any comments are yet again very much appreciated on this topic :-)
Comments
Thanks for the code, one problem though...
on line 79 of Table.php
is backwards, it should be
Thanks for the report, I'll fix that asap
Maybe I'm stupid but where does 'new URLs' come from in 'new Riskle_Db_Table_Paginate(new URLs, $this->_getParam('page'));' ?
I just can't find it anywhere :/
Hi Rvo, Urls is a class of mine extending Zend_Db_Table (ZDT). You can pass any class extending ZDT to the pagination component.
Hi,
I think your SVN is down. Any chance of posting the code in the blog instead?
Thanks.
Hi Paul, there's a new version of this component available at http://fashion.hosmoz.net/post/2007...
Regards,
Geoffrey
hi ,
this page r supports ZF 1.5 ???
I try with 1.5 and does not work... If someone have a pagination component working in version 1.5 say something in this blog... :)