public function pagination() { $this->prev_caption('Anterior'); $this->next_caption('Próximo '); $this->link_separator('/'); $this->info_navigation = 'de'; Paginate::$execute = true; return $this->paginate(10); }
public function paginate($quantity = null) { $page = Request::in_get('p'); if (empty($page)) { $page = 1; $path = $_GET['page']; } $start = ($page - 1) * $quantity; self::$execute = ceil(count($this->select()) / $quantity); $query = $this->db->prepare("SELECT * FROM {$this->table} LIMIT {$start}, {$quantity}"); $query->execute(); return $this->fetch($query); }