Refactoring Paginator.
This commit is contained in:
parent
7ec88d3faa
commit
9a36124b9e
|
@ -51,15 +51,15 @@ public function __construct($results, $total, $per_page)
|
|||
$this->results = $results;
|
||||
$this->total = $total;
|
||||
|
||||
// Validate and set the current page. If the given page is greater than the last page, the
|
||||
// current page will be set to the last page. If the given page is not an integer or is less
|
||||
// than 1, the current page will be set to 1.
|
||||
$this->page = static::page($this->last_page());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current page from the request query string.
|
||||
*
|
||||
* The page will be validated and adjusted if it is less than 1 or
|
||||
* greater than the last page number.
|
||||
*
|
||||
* @param int $last_page
|
||||
* @return int
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue