Re: Questions on Pager

From: Date: Thu, 06 Nov 2003 17:20:40 +0000
Subject: Re: Questions on Pager
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8817@lists.php.net to get a copy of this message
Hi Bertrand, actually Pager let you do pretty much everything you need... There's plenty of methods to retrieve every bit of information. Just have a look at the manual, I hope I have covered everything, if something is not clear, please let me know: http://pear.php.net/manual/en/package.html.pager.php About URL forging: if your current page url has other query string variables (different from the ones used by pager, I mean), then they're passed along to other pages, just try and you'll see. If you want to build your links yourself, that's fine. It's more work for you, but you can do it. Some useful methods can help you with that: Pager::getNextPageID(); Pager::getOffsetByPageId() Pager::getPreviousPageID() Pager::numItems() Pager::numPages() Pager::getPageData() Uh, you also may find useful the following class var: $pager->range; There's a note about it in the Intro: http://pear.php.net/manual/en/package.html.pager.intro.php, look at the bottom of Example 1. If you need other explanations, please send a mail. I'll be back in half an hour. Best regards, Lorenzo On Thu, 06 Nov 2003 17:28:26 +0100, Bertrand Mansion wrote: > Hi, > > Is it possible to have Pager return the number of the first item > being displayed in place of the page number ? The way it was with > DB_Pager. > > Is it possible to forge the url with custom keys and values ? > Example : url.php?pageID=2&sort=asc > > If not, what is the prefered way to add vars to the url. > > > All in all, I think it's a pity that the pager only returns forged > urls instead of raw data. That's against MVC pattern and doesn't > allow customization. The class should be able to return an array > like DB_Pager does, it seems much more useful. Unless I missed > something... > > Thanks, > > > Bertrand Mansion > Mamasam

« previous php.pear.general (#8817) next »