Pagination Not working

Permalink
Working on a new package, and pagination seems to display all the items on one page even though I've specified a limit lower than the number that appear. Controller code:
public function view($page=0){
   $sql="SELECT COUNT(email) FROM tableName";
   $total=$db->query($sql);
   $total=str_replace('COUNT(email)','', $total);   
        $query = "SELECT * FROM tableName "; 
       $rows = $db->getAll($query);
   $paginator->init(intval($page), $total, View::url('/invite_list'), 10);
        $this->set('rows', $rows);
}
I feel like it has something to do with the page number, but I really don't know, but maybe i'm supposed to have something in view? Right now all I have in view related to paging is
if($paginator && strlen($paginator->getPages())>0){ ?>    
       <div  class="pagination">
          <div class="pageLeft"><?php echo $paginator->getPrevious()?></div>
          <div class="pageRight"><?php echo $paginator->getNext()?></div>
          <?php echo $paginator->getPages()?>
       </div>      
   <? } ?>
So far I've been going off the log dashboard page to get this btw.

12345j
 
12345j replied on at Permalink Reply
12345j
bump

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.