Zend Framework 2 - Pagination

谁都会走 提交于 2019-12-06 12:44:31

this is the expected bahaviour.

You have set items per page to 2, and current page to 1.

this means you will get back all items on the first page, ie. items 1 and 2.

If you want the total pages in the collection use this:

$paginator->count();

Current page number:

$paginator->getCurrentPageNumber()

You are asking to get current page count in the controller, but why? You are setting this value in your controller so you must already have it (setCurrentPageNumber(..))..

If you let me know what you are trying to do maybe I can show you a better example of how to do it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!