Re: New SlidingWindowPager Class
| From: | Lorenzo Alberton | Date: | Thu, 14 Nov 2002 19:33:55 +0000 |
| Subject: | Re: New SlidingWindowPager Class | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-10800@lists.php.net to get a copy of this message | ||
14/11/2002 19.41.30
> i would assume the simpletemplate/flexy (and posibly smarty) code for
> it would look something like this. so range would be a associative
> array...
>
> {foreach:t.range,key,active}
> {if:active}{key}{else:}<a href="someurl?page={key}">{key}</a>{end:}
> {end:}
I wonder why you would do that. The pager is supposed to take care of
that already. It doesn't only "page" the data, it also builds the links.
Maybe I'm missing the point here... Do you need those
values for other purposes than the "1 2 3 ... next>>"?
On current page of course <a href></a> is omitted...
I'm already using this class with smarty, and what I do is:
- build the pager
- assign the "1 2 3 ... next>>" string to a variable
- use that variable in my template, without any need of
the foreach up here.
example:
// build the pager object
$pager = new SlidingWindowPager($options);
// then assign links to a smarty variable:
$smarty->assign("links", $pager->links);
just like that...
Sorry, but I'm a little bit confused...
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]