public applyPaginator ( Nette\Utils\Paginator $paginator, integer $itemsPerPage = NULL ) : |
||
$paginator | Nette\Utils\Paginator | |
$itemsPerPage | integer | |
Результат |
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(); }
public function render() { $template = $this->getTemplate(); $this->switchTemplateByMessagesType($template); $this->resultSet = $this->messagesHandler->getResultSet(); $paginator = $this['paginator']->getPaginator(); $this->resultSet->applyPaginator($paginator, 10); $messages = $this->resultSet->toArray(AbstractQuery::HYDRATE_ARRAY); $template->messages = $messages; $template->numberOfMessages = $paginator->getItemCount(); $template->render(); }
public function filterResultSet(Kdyby\Doctrine\ResultSet $resultSet) { $resultSet->applyPaginator($paginator = $this->getPaginator()); $this->page = max(1, min($paginator->getPageCount(), (int) $this->page)); }