PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Pager extraVars question

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> HTTP
View previous topic :: View next topic  
Author Message
chirpy



Joined: 29 Jan 2008
Posts: 2
Location: Seattle

PostPosted: Wed Jan 30, 2008 12:15 am    Post subject: Pager extraVars question Reply with quote

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
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1011

PostPosted: Wed Jan 30, 2008 1:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
chirpy



Joined: 29 Jan 2008
Posts: 2
Location: Seattle

PostPosted: Wed Jan 30, 2008 8:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> HTTP All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software