Refactoring paginator class.

This commit is contained in:
Taylor Otwell 2011-07-22 09:55:11 -07:00
parent 677747c4ca
commit f0e3134442
1 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,9 @@ public function __construct($results, $total, $per_page)
*/
public static function page($total, $per_page)
{
if (is_numeric($page = Input::get('page', 1)) and $page > $last_page = ceil($total / $per_page))
$page = Input::get('page', 1);
if (is_numeric($page) and $page > $last_page = ceil($total / $per_page))
{
return $last_page;
}