 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
chirpy
Joined: 29 Jan 2008 Posts: 2 Location: Seattle
|
Posted: Wed Jan 30, 2008 12:15 am Post subject: Pager extraVars question |
|
|
How does the Pager extraVars work?
My real question: How do I keep my URL parameters after the "items per page" select form has been submitted. Selecting a different number of items per page clears the URL parameters and I get all the results in my database! (very nicely paginated, however!)
This page:
http://pear.php.net/manual/en/package.html.pager.intro.php
instructs me to use extraVars, so this is what I tried:
| Code: | $params = array(
'itemData' => $ALL_DATA ,
'perPage' => 10,
'delta' => 5,
'append' => true,
'clearIfVoid' => true,
'urlVar' => 'entrant',
'useSessions' => true,
'closeSession' => true,
'mode' => 'Sliding',
'extraVars' => array(
'userTerm' => $_GET['userTerm'],
'term' => $_GET['term'],
),
); |
I looked around in the HtmlWidgets.php file, where the getPageSelectBox function is defined, but nothing I did there made any difference.
Thanks for any ideas. |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1011
|
Posted: Wed Jan 30, 2008 1:08 pm Post subject: |
|
|
| Just a guess: Are you sure that the GET protocol is used? If it isn't, the values of $_GET[...] will be empty ... |
|
| Back to top |
|
 |
chirpy
Joined: 29 Jan 2008 Posts: 2 Location: Seattle
|
Posted: Wed Jan 30, 2008 8:30 pm Post subject: |
|
|
Yes, I know the GET protocol is used.
After staring at the URL produced from extraVars parameter I'm pretty sure that's not my solution. extraVars puts the parameter in the URL produced for the links to each page of pagination.
What I need is 1 specific GET parameter to go into the "items per page" URL and despite my adding this code to the form:
| Code: | | <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']). '?userTerm='. htmlspecialchars($_GET['userTerm']); ?>" method="GET"> |
the parameter seems to get stripped away by the function that controls the form's action (the HtmlWidgets.php file, I believe). So I guess I'll go back to that function and mess around.
My php abilities are limited to copy and adapt. If anyone has modified the HtmlWidgets.php file I would love to hear about it.
Thanks. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|