From de48e194c7b02407ace412f87e36540e1bd8d3ab Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 22 Jul 2011 09:52:00 -0700 Subject: [PATCH] Replace last_page method with property. --- system/paginator.php | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/system/paginator.php b/system/paginator.php index e91ff63d..60b7f4cb 100644 --- a/system/paginator.php +++ b/system/paginator.php @@ -59,6 +59,8 @@ class Paginator { $this->per_page = $per_page; $this->results = $results; $this->total = $total; + + $this->last_page = ceil($total / $per_page); } /** @@ -88,7 +90,7 @@ class Paginator { */ public function links($adjacent = 3) { - return ($this->last_page() > 1) ? '