From f0e31344428137b7b8b54ddc0f2104327ff945d4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 22 Jul 2011 09:55:11 -0700 Subject: [PATCH] Refactoring paginator class. --- system/paginator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/paginator.php b/system/paginator.php index e4cfe123..a772d28a 100644 --- a/system/paginator.php +++ b/system/paginator.php @@ -67,7 +67,9 @@ class Paginator { */ 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; }