简体   繁体   English

Zend Paginator结束后如何获取所有物品

[英]How to get all items after Zend Paginator ends

I have built a Zend Paginator in my indexController. 我在indexController中建立了一个Zend Paginator。 On the frontend there are listed the categories 20 per page but I also have a dropdown that has to list all main categories. 在前端,列出了每页20个类别,但我还有一个下拉列表,其中列出了所有主要类别。 Is there a way to use the same query? 有没有办法使用相同的查询? This is what I have tried so far: 到目前为止,这是我尝试过的:

$query = $categories->select()
        ->where($status)
        ->where($sq)
        ->order($this->view->sortoptions->by . ' ' . $this->view->sortoptions->order);


    $this->view->categories = $categories->paginate($query->where($cat), $this->view->LayoutSettings->pagination->itemsperpage , $page);
    $this->view->categoriesall = $categories->fetchAll($query->where("parent = 0")); // we get this for the categories listing in the dropdown

** $status and $sq are filtering parameter (eg. parent = 0) ** $ status和$ sq是过滤参数(例如,parent = 0)

您将必须执行查询,因为zend paginator不会获取所有记录-而是一次获取$itemsperpage记录数!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM