View Single Post
Old 04-18-2009, 03:32 PM   #15 (permalink)
ETbyrne
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

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!
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote