RE: [PEAR] Pager: problem with getCurrentPageID()
| From: | Simon H | Date: | Sun, 04 Jan 2004 03:47:49 +0000 |
| Subject: | RE: [PEAR] Pager: problem with getCurrentPageID() | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9948@lists.php.net to get a copy of this message | ||
> Hi
>
> On Sat, 3 Jan 2004 21:17:41 -0000, Simon H wrote:
> > I use $this->pageID rather than passing $_GET['pageID'] but
> the Pager
> > class seems to rely on the GET var to produce the right results in
> > getLinks(), getCurrentPageID(), etc. In getLinks I can
> > $this->pager->getLinks($this->pageID) which fixes the links but
> > current, next and previous don't work.
> >
> > Would it be possible to allow the passing of the $pageID in the
> > Pager_Sliding contructor as an option - 'currentPage' (not
> sure that
> > when setOption is called, it would overwrite $this-
> > >_currentPage but might be a way to do it if it does?)?
> >
> > Any further suggestions to fix this?
>
>
> uhm... the idea is nice, and the solution easy to implement.
> I'll consider if adding such an option in the official
> package, in the meanwhile you can fix your own copy doing the
> following
> changes:
>
> open Pager/Common.php, and add a 'currentPage' option to the
> $allowed_options array in function _setOption().
> Then add the following lines just before the ending brace of
> the same method:
>
> if (isset($options['currentPage'])) {
> $this->_currentPage = $options['currentPage']; }
>
>
> That should do the trick :-)
Thanks Lorenzo
I just tried something very similar but your suggestion is slightly more
graceful.
It would be nice if this could be implemented in the package.
>
> Best regards,
> Lorenzo
--
Simon H