Skip to content
Snippets Groups Projects

adding condition for pager in case limit is zero

1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -75,7 +75,7 @@ protected function setCurrentPage($currentPage = 0) {
* The maximum number of items per page.
*/
protected function setTotalPages($totalItems, $limit) {
$this->totalPages = (int) ceil($totalItems / $limit);
$this->totalPages = $limit > 0 ? (int) ceil($totalItems / $limit) : 1;
}
/**
Loading