I have built a Zend Paginator in my indexController. On the frontend there are listed the categories 20 per page but I also have a dropdown that has to list all main categories. 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)
您将必须执行查询,因为zend paginator不会获取所有记录-而是一次获取$itemsperpage
记录数!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.