有人知道如何将Shanty-Mongo适配器与Zend Pagination集成吗?
https://github.com/coen-hyde/Shanty-Mongo
这是我在下一页上找到的片段,但不知道$ cursor变量引用了什么:
$adapter = new Shanty_Paginator_Adapter_Mongo(Shanty_Mongo_Iterator_Cursor $cursor);
$paginator = new Zend_Paginator($adapter);
答案 0 :(得分:1)
计算解决方案。这是我的查询示例......
$cursor = Model_Mongo_Locations::all();
$adapter = new Shanty_Paginator_Adapter_Mongo($cursor);
$paginator = new Zend_Paginator($adapter);
$page = $this->getRequest()->getParam('page');
$page = $filter->filter($page);
$paginator->setCurrentPageNumber($page);
$paginator->setItemCountPerPage(6);
$paginator->setPageRange(5);