private function getSortingAnchor() { $httpService = new HttpService(); $anchor = $this->html->el('a'); $attributes = array(); $attributes['href'] = $httpService->getSortUrl($this->getColumnName()); $anchor->addAttributes($attributes); $anchor->setText($this->getCellData()); return $anchor; }
private function startPaginator(HttpService $httpService, array $rows) { $this->paginator->setPage($httpService->getPaginatorPage()); if (is_null($this->paginator->getItemCount())) { $this->paginator->setItemCount(count($rows)); } return array_slice($rows, $this->paginator->offset, $this->paginator->itemsPerPage); }
private function buildPaginatorPages(Html $unorderedList) { $actualPage = $this->paginator->page; for ($i = 1; $i <= $this->paginator->pageCount; $i++) { if ($this->shouldSkipThisPaginationPage($i)) { continue; } $httpService = new HttpService(); $paginationUrl = $httpService->getUrlWithPaginator($i); $listItem = $this->html->el('li'); $anchor = $this->html->el('a')->addAttributes(array('href' => $paginationUrl))->setText($i); if ($actualPage == $i) { $listItem->addAttributes(array('class' => 'active')); } $listItem->add($anchor); $unorderedList->add($listItem); } }