public function renderDefault($page = 1) { $empty = FALSE; $paginator = new Paginator(); $paginator->setItemsPerPage($this->itemsPerPage); $paginator->setPage($page); $this->template->listOfObjects = $this->prepareListResource(); // CALC COUNT $count = $this->template->listOfObjects->count(); $paginator->setItemCount($count); $this->template->listOfObjects->limit($paginator->getLength(), $paginator->getOffset()); if ($this->template->listOfObjects->count() == 0) { $empty = TRUE; } $this->template->empty = $empty; $this->template->page = $page; if ($count > $this->itemsPerPage && !$paginator->isLast()) { $this->template->showMoreButton = TRUE; } if ($this->ajax) { $this->redrawControl('datalist'); } }
public function renderSimple($page = 1) { $empty = FALSE; $itemsPerPage = 10; $paginator = new Paginator(); $paginator->setItemsPerPage($itemsPerPage); $paginator->setPage($page); // BASE QUERY $this->template->listOfObjects = $this->database->table('image'); // CALC COUNT $count = $this->template->listOfObjects->count(); $paginator->setItemCount($count); $this->template->listOfObjects->limit($paginator->getLength(), $paginator->getOffset()); if ($this->template->listOfObjects->count() == 0) { $empty = TRUE; } $this->template->empty = $empty; $this->template->page = $page; if ($count > $itemsPerPage && !$paginator->isLast()) { $this->template->showMoreButton = TRUE; } if ($this->ajax) { $this->redrawControl('datalist'); } }
private function getLastPaginationListItem() { return $this->getNextOrPreviousPaginationButton('Next', '»', $this->paginator->isLast(), 1); }