mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 19:43:49 +00:00
fix pagination problems
This commit is contained in:
@@ -109,6 +109,10 @@ class Paginator implements PaginatorInterface
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (0 === $this->totalItems) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
$nb = floor($this->totalItems / $this->itemPerPage);
|
||||
|
||||
if ($this->totalItems % $this->itemPerPage > 0) {
|
||||
@@ -211,6 +215,10 @@ class Paginator implements PaginatorInterface
|
||||
|
||||
public function hasPage($number)
|
||||
{
|
||||
if (0 === $this->totalItems) {
|
||||
return 1 === $number;
|
||||
}
|
||||
|
||||
return 0 < $number
|
||||
&& $this->countPages() >= $number;
|
||||
}
|
||||
|
Reference in New Issue
Block a user