在 zend Paginator 中添加(显示当前开始到总条目数)
我想做的是,我想向用户展示我
Showing 1 to 10 of 50 entries
Showing 11 to 20 of 50 entries
Showing 21 to 30 of 50 entries
Showing 31 to 40 of 50 entries
Showing 41 to 50 of 50 entries
在我的应用程序中使用了 Zend Paginator 可以说
Showing A to B of C entries
我可以轻松找到 C ,它等于
$result = $DB->fetchAll($sql);
$total =count($result);
如果我们在这里看到
$page=$this->_getParam('page',1);
//here we can get the requested page#.
//lets hard code this
$paginator->setItemCountPerPage(10);
$per_page =10;
in my view count($this->paginator) give me total number of pages that is if
if total = 101 = $total
than page = 9 = $page
and paginator = 11 = count($this->paginator)
我如何实现这一点,但通用意味着与下一个、上一个等一起工作在..
what i want to do is that i wana show user this
Showing 1 to 10 of 50 entries
Showing 11 to 20 of 50 entries
Showing 21 to 30 of 50 entries
Showing 31 to 40 of 50 entries
Showing 41 to 50 of 50 entries
i have used Zend Paginator in my app lets say
Showing A to B of C entries
I can easily find C which is equal to
$result = $DB->fetchAll($sql);
$total =count($result);
if we see here
$page=$this->_getParam('page',1);
//here we can get the requested page#.
//lets hard code this
$paginator->setItemCountPerPage(10);
$per_page =10;
in my view count($this->paginator) give me total number of pages that is if
if total = 101 = $total
than page = 9 = $page
and paginator = 11 = count($this->paginator)
how can i achieve this but generic mean working with next,previous and so on..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
大致是这样的:
Is roughly this: