Reputation: 9645
$paginator = Zend_Paginator::factory($select);
$paginator->setItemCountPerPage($s['perPage']);
$paginator->setPageRange(15);
$paginator->setCurrentPageNumber((int)$s['page']);
return $paginator;
How to get overall page count from paginator?
Because i want to set 404 header if requested page is > than overall.
Thanks ;)
Upvotes: 2
Views: 2762
Reputation: 3285
You can access overall number of pages with
$paginator->getPages()->pageCount
But basically it just returns the $select->count()
value (so piddl0r's guess was correct).
Upvotes: 7
Reputation: 2449
I don't know how it was generated but wouldn't counting the select do the trick?
count($select);
If the the data is coming from database Zend_Paginator_Adapter_DbSelect as an adapter for the paginator is helpful.
Upvotes: 0