Skip to content

Commit

Permalink
added offset property for query offset
Browse files Browse the repository at this point in the history
  • Loading branch information
kerkness authored and GeertDD committed Oct 18, 2009
1 parent 8b2af1a commit b7eac0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion classes/kohana/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class Kohana_Pagination {
// Last page number; FALSE if the current page is the last one
protected $last_page;

// Query offset
protected $offset;

/**
* Creates a new Pagination object.
*
Expand Down Expand Up @@ -156,11 +159,12 @@ public function setup(array $config = array())
$this->next_page = ($this->current_page < $this->total_pages) ? $this->current_page + 1 : FALSE;
$this->first_page = ($this->current_page === 1) ? FALSE : 1;
$this->last_page = ($this->current_page >= $this->total_pages) ? FALSE : $this->total_pages;
$this->offset = (int) (($this->items_per_page * $this->current_page) - $this->items_per_page);
}

// Chainable method
return $this;
}
}

/**
* Generates the full URL for a certain page.
Expand Down

0 comments on commit b7eac0f

Please sign in to comment.