I am using Zend_Paginator in my web-page, where I get the same records in each page....
我在我的网页中使用Zend_Paginator,我在每个页面中获得相同的记录....
For Eg. I got the same 4 records in different pages...?
对于Eg。我在不同的页面中得到了相同的4条记录......?
$page=$this->_getParam('page',1);
$paginator = Zend_Paginator::factory($userDetails);
$paginator->setItemCountPerPage(4);
$paginator->setCurrentPageNumber($page);
$this->view->paginator = $paginator;
What may be the problem?
可能是什么问题?
Please help.....
请帮忙.....
Thanks in advance.....
提前致谢.....
2 个解决方案
#1
2
If this records you get fro DB, you should make limitPage($page, $rowCount)
. Or if your data not from DB, you should filtering it by other way. Sorry for my english.
如果这个记录你得到了DB,你应该创建limitPage($ page,$ rowCount)。或者,如果您的数据不是来自数据库,则应通过其他方式对其进行过滤。对不起我的英语不好。
#2
1
Hard to say with that little information but the most obvious explanation is that $page
does not contain what you think it does. In other words, make sure you are actually sending a page parameter in the Request and make sure $page
contains that page number.
很难说这些小信息,但最明显的解释是$ page不包含你认为它的作用。换句话说,请确保您实际上在请求中发送页面参数,并确保$ page包含该页码。
If you can confirm that the correct page number is passed to setCurrentPageNumber
, use a Debugger to step through the program flow to see what happens. Consider upgrading your question with more details then.
如果您可以确认将正确的页码传递给setCurrentPageNumber,请使用调试器逐步执行程序流以查看发生的情况。请考虑使用更多详细信息升级您的问题。
#1
2
If this records you get fro DB, you should make limitPage($page, $rowCount)
. Or if your data not from DB, you should filtering it by other way. Sorry for my english.
如果这个记录你得到了DB,你应该创建limitPage($ page,$ rowCount)。或者,如果您的数据不是来自数据库,则应通过其他方式对其进行过滤。对不起我的英语不好。
#2
1
Hard to say with that little information but the most obvious explanation is that $page
does not contain what you think it does. In other words, make sure you are actually sending a page parameter in the Request and make sure $page
contains that page number.
很难说这些小信息,但最明显的解释是$ page不包含你认为它的作用。换句话说,请确保您实际上在请求中发送页面参数,并确保$ page包含该页码。
If you can confirm that the correct page number is passed to setCurrentPageNumber
, use a Debugger to step through the program flow to see what happens. Consider upgrading your question with more details then.
如果您可以确认将正确的页码传递给setCurrentPageNumber,请使用调试器逐步执行程序流以查看发生的情况。请考虑使用更多详细信息升级您的问题。