RE: [PEAR] Pager : force to display one page ID : SOLVED
| From: | Vincent DUPONT | Date: | Tue, 21 Dec 2004 17:12:18 +0000 |
| Subject: | RE: [PEAR] Pager : force to display one page ID : SOLVED | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16368@lists.php.net to get a copy of this message | ||
Massimiliano, your answer was on the right direction, but we need to user $_REQUEST[] instead of
$_GET.
The Pager uses the $_REQUEST[$options['urlVar']] to select the page to open. I found this
by going into the Pager files.
Maybe it could be nice to be able to set the pageId from the pager options.
Vincent
-----Original Message-----
From: Massimiliano Arione [mailto:garak@studenti.it]
Sent: mardi 21 décembre 2004 18:00
To: Vincent DUPONT
Subject: Re: [PEAR] Pager : force to display one page ID
> I would like to force Pager to display a particular page from PHP. By default, the first page
> is displayed.
> In the Pager Options, I found nothing like this.
> Actually, I need to be able to open the page that includes one specific record in the list. But
> this record may be on any page in the range.
> With getPageIdByOffset I can have the page ID where my record will be displayed. So I just need
> to be able to force Pager to open on that page, not on the first one.
a link like
yourpage.php?pageID=<?php echo $pager->getPageIdByOffset() ?>
or, in the page
<?php
if (!isset($_GET['pageID'])) {
$_GET['pageID'] = $pager->getPageIdByOffset();
}
?>
--
Massimiliano Arione
:: http://www.garak.it/ ::
** NO WORD http://www.gnu.org/philosophy/no-word-attachments.html
**
** NO HTML http://www.efn.no/html-bad.html **