如何限制分页结果的数量?

时间:2016-09-06 15:47:02

标签: limit cakephp-3.0

这是我的行动:

public function index()
    {
        $this->paginate = [
            'page' => 1,
            'limit' => 12,
            'maxLimit' => 12
        ];      
        $suppliers =$this->Suppliers->find('all')
            ->order(['Suppliers.description'=>'asc']);
        $suppliers = $this->paginate($suppliers);
        $this->set(compact('suppliers'));
        $this->set('_serialize', ['suppliers']);
    }

没有重要的价值我设置限制,最大限制..他总是从我的数据库中给我所有记录......

0 个答案:

没有答案