Hello World,
I'm using cakePHP to build out an open data API in Jamaica (the first of
its kinda here). Things have been going well thus far and I'm very happy
with our decision. At the moment I am running into an issue with
pagination. 

The basic problem is that I want to preserve the query passed to the
view from the controller. At the moment when the user selects the
default paginate the results for a particular query. Currently if you
are on a page with a particular query:
e.g
http://localhost/agroProjects/api/crops?parish=st.andrew&district=bloxburgh

If I click the Next or Prev button it goes to:
http://localhost/agroProjects/api/crops/index/page:2

Which returns page two of the default query. Instead it should go to:
http://localhost/agroProjects/api/crops/index/page:2?parish=st.andrew&district=bloxburgh

I suspect it may be related to how I use the paginator helper in the
View. The code is below
<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(),
null, array('class'=>'disabled'));?>
<?php echo $this->Paginator->numbers();?>
<?php echo $this->Paginator->next(__('next', true) . ' >>', array(),
null, array('class' => 'disabled'));?>

Any help would be greatly appreciated.


 (i.e not return the 250,000 records for every time I receive a query).
We decided to limit the results returned (for . 
$cropData = $this->paginate('Crop', $query);

But the issue is that that when I click "Next Page" in the view it
forgets the original query paramer
-- 
Regards,
Matthew McNaughton
www.twitter.com/mamcnaughton








-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to