Thursday, September 3, 2009

Complicated question with Pagination Neighbours

I have a search feature which I grab all the id's to pass to paginate which
looks like

app/controllers/posts_controller.php (line 259)
Array
(
[0] => 139ea7
[1] => 2a4370
[2] => 3fb952
[3] => 66bfb4
[4] => 8197d5
[5] => 87c28a
[6] => 97fd0f
[7] => a78629
[8] => cbe69d
[9] => e9915c
)

Now when you view each of the posts I would like to add neighbours so if
your viewing [2] => 3fb952, previous link would point to [1] => 2a4370 or
next would point to [3] => 66bfb4.
How can I use the array from the search to use with neighbours? Or whats the
best way to access the array info for next previous?

I tried

$neighbours = $this->Post->findNeighbours(array('Post.id' => $posts),
array('field' => 'Post.id'), NULL);

Which results in Error:: Undefined offset: 0

Ideas?

Thanks
Dave


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

No comments: