与Zend Paginator的分页显示前一个,第一个,最后一个,下一个,当前&当前+/- 1

时间:2014-03-26 16:15:32

标签: php zend-framework pagination

我试图使用Zend Paginator为我的页面组合分页。 我跟着这个例子(李戴维斯):http://www.duckheads.co.uk/zend-paginator-example/265

我期望在该页面的要求中更少描述:

Must be able to jump to the first results page at any time by clicking the first page number (1)
Must be able to jump to the last results page at any time by clicking the last page number
Must be able to jump forward one page
Must be able to jump back one page
Must show the current page the user is on
Must show surrounding pages from the page the user is currently on

我根据上面提到的文章实现了分页,但它并没有像我预期的截图那样完全正常。例如它在当前页面的每一侧显示超过1个周围页面。

文章的屏幕截图:http://i.stack.imgur.com/ihrIt.jpg

我用'滑动'来调用paginationControl方法。参数。

我想知道您是否知道对示例代码(来自文章)的任何修改都可以使其按预期工作,即将最后的要求更改为

Must show 1 surrounding page on each side of the page the user is currently on

提前感谢你以正确的方式推动我

1 个答案:

答案 0 :(得分:1)

查看文档,我认为如果添加以下内容,请设置Zend_Paginator:

$paginator = new Zend_Paginator(...);
$paginator->setPageRange(3);

它应该有用。

让我知情。 :)

相关问题