简体   繁体   中英

Zend_Paginator creating issues in webpage

I am using Zend_Paginator in my web-page, where I get the same records in each page....

For Eg. I got the same 4 records in different pages...?

$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.....

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM