How to Limit the paginate in cakephp

前端 未结 5 1497
时光说笑
时光说笑 2021-01-17 23:58

How to Limit the paginate in cakephp ?

Assume that i have 400 records.
I need to get only 25 records from 50th record to 75th record and need to display 5 recor

5条回答
  •  梦谈多话
    2021-01-18 00:13

    In cakephp 4.x version we have to call like below

     public function index()
        {
            $this->loadComponent('Paginator');
            $settings = array(
                'limit' => 50
            );
            $prices = $this->Paginator->paginate($this->Prices->find(), $settings);
            $this->set(compact('prices'));
        }
    

提交回复
热议问题