I am having some problems with finding neighbors in pagination. I have a
standard index whichs lists all the post -> view get the neighbours ok that
works no problem.
 
view function :
this gets me the posts before and after $post_id I pass
<code snip.....>
$neighbors = $this->Post->__getNeighbors($post_id, $rank,
$post['Post']['created']);
<.....>
 
My problem comes when viewing pages that come from a pagination. 
The view function will get the same neighbours obviously because the
variables re the same. What I need to do is pass the variables from one
function to the view from within the controller.
 
 Could I do something like this?
 
function view($post_id)
$params = $this->Session->read('User.Paginate');
$neighbors = $this->Post->__getNeighbors($post_id, $params);
$this->set(compact('neighbors'));
 
function search()
//search renders standard index.ctp view
//do what i need to do to create the pagination and set the params for the
neighbors and save them to the session
$query = Sanitize::paranoid($this->data, array(' ',','));
$string = $query['Job']['query'];
$posts = $this->Post->__quickQuery($string,
$this->Session->read('Auth.User.rank'));
$params = array'Post.rank => $this->Session->read('Auth.User.rank'),
'Post.created' => $z)
$this->Session->write(User.Paginate, $params);
 
function advancedsearch()
//search renders standard index.ctp view
//do what i need to do to create the pagination and set the params for the
neighbors and save them to the session
$query = Sanitize::paranoid($this->data, array(' ',','));
$string = $query['Job']['query'];
$posts = $this->Post->__advancedQuery($string,
$this->Session->read('Auth.User.rank'));
$params = array'Post.rank => $this->Session->read('Auth.User.rank'),
'Post.created' => $z)
$this->Session->write(User.Paginate, $params);
 
So basicaly the idea is to save the params to the seesion in one function so
another function can read it... 
 
Ideas, thoughts?
 
Thanks
Dave 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to