How to set maximum pagination limit in cakephp

My code

$this->paginate=array( 'conditions' =>array('OrderDetail.order_id'=>$id), 'maxLimit' => 500)); 

 $this->paginate=array( 'conditions' =>array('OrderDetail.order_id'=>$id), 'limit' => 500)); 

Both results give me a maximum of 100 records, I set the limit as 500, as if I set 500, I need 500 records.! can any body help me with this?

+6
source share
3 answers

If you think about it: you need to combine them.

 public $paginate = array( // other keys here. 'maxLimit' => 500, 'limit' => 500 ); 

You need to raise maxLimit to the absolute limit you want to allow first. Then you can set a limit for any value up to this point. Just installing one of them does not change anything (logically).

+11
source

Set a limit for paginator on

 $this->Paginator->settings = array('limit' => ''); 

Now paginator will find all records from the table

0
source
 $this->Paginator->settings = array('limit' => '-1'); 

Add this to the top of your function and get all the data without any errors.

0
source

Source: https://habr.com/ru/post/946688/


All Articles