04-18-2009, 03:32 PM
|
#15 (permalink)
|
|
how quixotic are you?
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
|
You should change getPages so that you can give it a int value OR an array of data. Like so:
PHP Code:
public function getPages($results) { if(is_array($results)){ $this->totalResults = count($results); }else{ $this->totalResults = $results; } $totalPages = $this->totalResults / $this->totalPerPage; $this->totalPages = ceil($totalPages); $x = 1; $array = array(); while($x <= $this->totalPages) { $array[] = $x; $x++; } return $array; }
All in all a very useful class Tanax!
|
|
|
|