[eluser]Chillahan[/eluser]
Whoa - where is CI automatically generating the offset? I echo'ed its config value for per_page before and after ->initialize, no change. (and why would there be? per_page is pretty static.)
This is how I calculate my offset -
if ($this->uri->segment(3))
{
$itemStartIndex = (($this->uri->segment(3) - 1) * $itemsPerPage);
}
else
{
$itemStartIndex = '0';
}
Note that I test segment(3) for existence since if it doesn't exist, it means we're at page 1, so offset should be zero (not 1).
Anyway, I am still having a problem - class pagination will generate a link that says page 3, for example, but when I click it it goes to page 4, which doesn't exist. I am starting to think there is a bug in class pagination for very small page sizes (i.e., two items per page). Anyone else notice this?