Re: Pager_Sliding using strings?
| From: | Davey | Date: | Sat, 26 Jul 2003 11:31:15 +0000 |
| Subject: | Re: Pager_Sliding using strings? | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-6837@lists.php.net to get a copy of this message | ||
Lorenzo Alberton wrote:
On Fri, 25 Jul 2003 18:12:25 +0100, Davey wrote:Hurrah! Heres what I have: $data = array('foo','bar'); $params = array( 'itemData' => $data, 'perPage' => 1, 'delta' => 2, 'append' => TRUE, 'seperator' => ' | ', 'clearIfVoid' => FALSE, 'urlVar' => 'entrant' ); $pager = &new Pager_Sliding($params); $page_data = $pager->getPageData(); $entrant = implode('',$page_data); $entrant now contains "foo" or "bar" depending on the page and I can so my: SELECT column FROM tbale WHERE name='$entrant' The pager is still numerical but at least the DB call doesn't depend on the page number :) Also, I must note the implode() to get the $entrant, it seems the array returned, the data is in the same index in that array as in the $data array... is this a bug? shouldn't it always be in [0] ? - DaveyWhat I have is a database with contestants in it, what I want is a slide show of the contestants details, and I want the links to be the contestants names, not their page number/database id. Note that the not all contestants are in every competition and therefore their numbers are not sequentialI see. Well, maybe you should consider extending Pager or Pager_Sliding and overriding the _getPageLinks(), _getBackLink() and _getNextLink() methods. But for your purpose, maybe a simple custom pager would be easier to implement... dunno. Lorenzo