Browse Source

Tweaking paginator class.

Taylor Otwell 13 years ago
parent
commit
873e4ee2d7
1 changed files with 3 additions and 1 deletions
  1. 3 1
      system/paginator.php

+ 3 - 1
system/paginator.php

@@ -47,10 +47,12 @@ class Paginator {
 	 */
 	public function __construct($results, $total, $per_page)
 	{
-		$this->page = static::page($total, $per_page);
 		$this->per_page = $per_page;
 		$this->results = $results;
 		$this->total = $total;
+
+		// Determine the current page based on the total results and per page limit.
+		$this->page = static::page($this->total, $this->per_page);
 	}
 
 	/**