Pushpendra
Pushpendra

Reputation: 4382

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

Upvotes: 11

Views: 385

Answers (2)

Gordon
Gordon

Reputation: 317089

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.

Upvotes: 1

Alex Pliutau
Alex Pliutau

Reputation: 21947

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.

Upvotes: 3

Related Questions