Re: New SlidingWindowPager Class
| From: | Lorenzo Alberton | Date: | Wed, 13 Nov 2002 08:19:30 +0000 |
| Subject: | Re: New SlidingWindowPager Class | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-10749@lists.php.net to get a copy of this message | ||
13/11/2002 9.19.30
> looks really nice +1
>
> is there any way to get some kind of array of data summarizing the
> bar.. - I had alot of trouble before trying to use the Pager class
> with a template engine. - all it needed was something like this.
>
>
> Array =>
> beginID =>1 // or FALSE
> backID => 2 // or FALSE
> range
> [2] => FALSE
> [3] => TRUE // (selected)
> [4] => FALSE
> [5] => FALSE;
> forwardID => 4 // or FALSE
> endID => 80 // or FALSE
>
> from this It should be possible to build the pager display in the
> template
>
> Regards
> Alan
I don't know if I understand...
{back | forward | end}ID should be already implemented...
They are provided by these methods:
- $pager->getPreviousPageID()
- $pager->getNextPageID()
- $pager->numPages() || $pager->isLastPage()
- begin is obviously #1... there's no specific method for the ID...
You can check if the result is empty using $pager->numItems()
What you ask is a bool value for each page number in the "range"
with a "true" value if it's the current page, right?
Mmmm... yes, it is possible to do so. In the meanwhile you can
obtain what you want with a little extra work:
The method $pager->getCurrentPageID() returns ...guess what? :-)
You can compare it with page numbers and select the right bool value.
But if you really think it's a "must have", I'll implement it directly
in the pager...
A complete PHPDoc on the methods available can be found in the tarball:
http://cambiano.onlinein.it/pearzone/scripts/SlidingWindowPager.tar.gz
http://cambiano.onlinein.it/pearzone/scripts/SlidingWindowPager.zip
(it's not updated to the last addition, which is "expanded" mode...)
Regards,
Lorenzo
---
[Quipo ISP - Questa E-mail e' stata controllata dal programma Declude Virus]
[Quipo ISP - This E-mail was scanned for viruses by Declude Virus]