Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 939
Pushpendra Avatar asked Jan 29 '11 10:01

Pushpendra


2 Answers

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.

like image 145
Alex Pliutau Avatar answered Oct 04 '22 01:10

Alex Pliutau


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.

like image 20
Gordon Avatar answered Oct 04 '22 01:10

Gordon