php-paginator
php-paginator copied to clipboard
alter function ceil per floor in updateNumPages
protected function updateNumPages(){ $this->numPages = ($this->itemsPerPage == 0 ? 0 : (int) floor($this->totalItems/$this->itemsPerPage)); }
If you round down wouldn't you need up with orphan items?
Example: lets say we have 25 items with 10 items per page.
if we use floor we would round 2.5 down to 2 pages, leaving 5 items orphaned.
if we use ceil we would round 2.5 up to 3 pages, making sure that the last 5 items are not orphaned.