pagination->getPageCount(); if ($pageCount < 2 && $this->hideOnSinglePage) { return ''; } $buttons = []; $currentPage = $this->pagination->getPage(); // first page if ($this->firstPageLabel !== FALSE) { $buttons[] = $this->renderPageButton($this->firstPageLabel, 0, $this->firstPageCssClass, $currentPage <= 0, FALSE); } // prev page if ($this->prevPageLabel !== FALSE) { if (($page = $currentPage - 1) < 0) { $page = 0; } $buttons[] = $this->renderPageButton($this->prevPageLabel, $page, $this->prevPageCssClass, $currentPage <= 0, FALSE); } // internal pages list($beginPage, $endPage) = $this->getPageRange(); for ($i = $beginPage; $i <= $endPage; ++$i) { $buttons[] = $this->renderPageButton($i + 1, $i, NULL, FALSE, $i == $currentPage); } // next page if ($this->nextPageLabel !== FALSE) { if (($page = $currentPage + 1) >= $pageCount - 1) { $page = $pageCount - 1; } $buttons[] = $this->renderPageButton($this->nextPageLabel, $page, $this->nextPageCssClass, $currentPage >= $pageCount - 1, FALSE); } // last page if ($this->lastPageLabel !== FALSE) { $buttons[] = $this->renderPageButton($this->lastPageLabel, $pageCount - 1, $this->lastPageCssClass, $currentPage >= $pageCount - 1, FALSE); } return html::tag('div', Html::tag('ul', implode("\n", $buttons), $this->options), ['class' => 'dataTables_paginate paging_bootstrap pagination']); //return Html::tag('ul', implode("\n", $buttons), $this->options); } }