forked from Public/pics
Prevent current page from being 0 if no items are present
This commit is contained in:
@@ -63,9 +63,9 @@ class PageIndex
|
||||
lower current/cont. pgs. center upper
|
||||
*/
|
||||
|
||||
$this->num_pages = ceil($this->recordCount / $this->items_per_page);
|
||||
$this->num_pages = max(1, ceil($this->recordCount / $this->items_per_page));
|
||||
$this->current_page = min(ceil($this->start / $this->items_per_page) + 1, $this->num_pages);
|
||||
if ($this->num_pages == 0)
|
||||
if ($this->num_pages <= 1)
|
||||
{
|
||||
$this->needsPageIndex = false;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user