|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
rhutchison Smarty n00b
Joined: 18 Mar 2005 Posts: 4 Location: New Jersey
|
Posted: Fri Mar 18, 2005 1:15 am Post subject: SmartyPaginate and $_GET/$_POST/$_REQUEST Variables |
|
|
Monte,
I would first like to start off by saying great effort on SmartyPaginate. While setting up SmartyPaginate myself, I had a hard time trying to figure out how to pass php values as I paginate through my results. I browsed the forum and looked through the README about 50 times and am still stuck. This maybe because it isn't possible yet, or I have just overlooked it. Anyhow what I am trying to do, and what it seems like others are trying to do, is pass some values through the url.
Example:
I am looking through a database full of names, and I would like to find all the results with the name 'Ryan'.
i.e. http://www.namedb.com/?name=Ryan
"SELECT * FROM names WHERE firstname='Ryan' LIMIT 0,10"
The first page displays my results without a problem. However if I click on another page or the {pagination_next} my URL will look as follows:
i.e. http://www.namedb.com/?next=11
"SELECT * FROM names WHERE firstname='' LIMIT 11,21"
Is there currently a way to pass my criteria in the url? If not currently, is there something in the works to allow this? It seems like everyone who has posted on the forum is clueless when it comes to doing something like this.
Any response would be appreciated. _________________ Ryan Hutchison
CEO
Gym Solutions, LLC. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 18, 2005 2:37 pm Post subject: |
|
|
You need your base URL to include the name=Ryan part.
SmartyPaginate::setUrl('http://www.namedb.com/?name=Ryan');
That only needs to be done once, not every invocation. You could also keep your query/params in a session. That would be the duty of your application though, not SmartyPaginate. |
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|