public function getPages()
    {
        $pages = [];

        if($this->numPages <= 1)
        {
            return [];
        }

        if($this->numPages <= $this->maxPagesToShow)
        {
            for($i = 1; $i <= $this->numPages; $i++)
            {
                $pages[] = $this->createPage($i, $i == $this->currentPage);
            }
        }
        else
        {
            // Determine the sliding range, centered around the current page.
            $numAdjacents = (int) floor(($this->maxPagesToShow - 3) / 2);

            if($this->currentPage + $numAdjacents > $this->numPages)
            {
                $slidingStart = $this->numPages - $this->maxPagesToShow + 2;
            }
            else
            {
                $slidingStart = $this->currentPage - $numAdjacents;
            }
            if($slidingStart < 2)
            {
                $slidingStart = 2;
            }

            $slidingEnd = $slidingStart + $this->maxPagesToShow - 3;
            if($slidingEnd >= $this->numPages)
            {
                $slidingEnd = $this->numPages - 1;
            }

            // Build the list of pages.
            $pages[] = $this->createPage(1, $this->currentPage == 1);
            if($slidingStart > 2)
            {
                $pages[] = $this->createPageEllipsis();
            }
            for($i = $slidingStart; $i <= $slidingEnd; $i++)
            {
                $pages[] = $this->createPage($i, $i == $this->currentPage);
            }
            if($slidingEnd < $this->numPages - 1)
            {
                $pages[] = $this->createPageEllipsis();
            }
            $pages[] = $this->createPage($this->numPages, $this->currentPage == $this->numPages);
        }

        return $pages;
    }