public function applyPaginator(UIPaginator $paginator, $itemsPerPage = NULL) { if ($itemsPerPage !== NULL) { $paginator->setItemsPerPage($itemsPerPage); } $paginator->setItemCount($this->getTotalCount()); $this->applyPaging($paginator->getOffset(), $paginator->getLength()); return $this; }
public function render() { $template = $this->getTemplate(); $template->setFile(__DIR__ . '/overview.latte'); $this->resultSet->applyPaginator($this['vs']->getPaginator(), $this->pagesPerPage); $this->pages = $this->resultSet->toArray(); $template->pages = $this->pages; $template->pagesCount = count($this->pages); $template->render(); }