How can I get the paramaters passed to the url on the first submission?
All subsequent pagination requests (such as when I hit Next>>) display the proper url parameters like (/35/0/...):
.../Plans/search/35/0/0/0开发者_高级运维/97378/page:2
But on the first search results page, the parameters are not passed (but the results are correct), so the url looks like this:
.../Plans/search/
So when I try to do a sort on the first page:
<?php $this->Paginator->sort('Sort by Monthly Cost','monthly_cost');?>
The results are cleared because no parameters are present. But every subsequent page (starting at page:2) the sort works fine because the params are in the url.
I need to know how to pass the params to the url on the initial search.
I've been trying variations of this in the view:
$this->Paginator->options(array('url' => $this->passedArgs));
But I can't get them to pass..
SOLVED!
In my view, I had an instance of:
options = array('url'=>$searchdetails); ?>
below my paginator counter near the page footer.
I took the same:
options = array('url'=>$searchdetails); ?>
And placed it in the header of my view, and it solved the issue.
It appears the vars were not being saved until I initiated the pagination by clicking Next>>, so adding it at the header saves the immediately on the first search.
So I removed the footer instance, and now only have:
options = array('url'=>$searchdetails); ?>
At the header of the page, and it carries all values to the url as expected : )
精彩评论