Example #1
0
 public function paginate($page = 1, $limit = 10, &$p = FALSE)
 {
     // Get row count
     $q = new DingoQuery('count');
     $q->table = $this->table;
     $q->where_list = $this->where_list;
     $q->order_list = $this->order_list;
     $q->_join = $this->_join;
     $count = $q->execute();
     // Paginate
     load::library('pagination');
     $p = new pagination($count, $page, $limit);
     $this->offset($p->min);
     $this->limit($limit);
     return $this;
 }