Neos\FluidAdaptor\ViewHelpers\Widget\Controller\PaginateController::calculateDisplayRange PHP Метод

calculateDisplayRange() защищенный Метод

If a certain number of links should be displayed, adjust before and after amounts accordingly.
protected calculateDisplayRange ( ) : void
Результат void
    protected function calculateDisplayRange()
    {
        $maximumNumberOfLinks = $this->maximumNumberOfLinks;
        if ($maximumNumberOfLinks > $this->numberOfPages) {
            $maximumNumberOfLinks = $this->numberOfPages;
        }
        $delta = floor($maximumNumberOfLinks / 2);
        $this->displayRangeStart = $this->currentPage - $delta;
        $this->displayRangeEnd = $this->currentPage + $delta + ($maximumNumberOfLinks % 2 === 0 ? 1 : 0);
        if ($this->displayRangeStart < 1) {
            $this->displayRangeEnd -= $this->displayRangeStart - 1;
        }
        if ($this->displayRangeEnd > $this->numberOfPages) {
            $this->displayRangeStart -= $this->displayRangeEnd - $this->numberOfPages;
        }
        $this->displayRangeStart = (int) max($this->displayRangeStart, 1);
        $this->displayRangeEnd = (int) min($this->displayRangeEnd, $this->numberOfPages);
    }