protected function calculateStartAndEndPage()
    {
        $currentPage = $this->pagerfanta->getCurrentPage();
        $nbPages = $this->pagerfanta->getNbPages();

        $startPage = $currentPage - $this->proximity;
        $endPage = $currentPage + $this->proximity;

        if ($startPage < 1) {
            $endPage = $this->calculateEndPageForStartPageUnderflow($startPage, $endPage, $nbPages);
            $startPage = 1;
        }

        if ($endPage > $nbPages) {
            $startPage = $this->calculateStartPageForEndPageOverflow($startPage, $endPage, $nbPages);
            $endPage = $nbPages;
        }

        $this->startPage = (int) $startPage;
        $this->endPage = (int) $endPage;
    }
protected function calculateStartAndEndPage()
    {
        $currentPage = $this->pagerfanta->getCurrentPage();
        $nbPages = $this->pagerfanta->getNbPages();

        $startPage = $currentPage - $this->proximity;
        $endPage = $currentPage + $this->proximity;

        if ($startPage < 1) {
            $endPage = $this->calculateEndPageForStartPageUnderflow($startPage, $endPage, $nbPages);
            $startPage = 1;
        }

        if ($endPage > $nbPages) {
            $startPage = $this->calculateStartPageForEndPageOverflow($startPage, $endPage, $nbPages);
            $endPage = $nbPages;
        }

        $this->startPage = (int) $startPage;
        $this->endPage = (int) $endPage;
    }
protected function calculateStartAndEndPage ( ) { $ currentPage = $ this -> pagerfanta -> getCurrentPage ( ) ; $ nbPages = $ this -> pagerfanta -> getNbPages ( ) ; $ startPage = $ currentPage - $ this -> proximity ; $ endPage = $ currentPage + $ this -> proximity ; if ( $ startPage < 1 ) { $ endPage = $ this -> calculateEndPageForStartPageUnderflow ( $ startPage , $ endPage , $ nbPages ) ; $ startPage = 1 ; } if ( $ endPage > $ nbPages ) { $ startPage = $ this -> calculateStartPageForEndPageOverflow ( $ startPage , $ endPage , $ nbPages ) ; $ endPage = $ nbPages ; } $ this -> startPage = ( int ) $ startPage ; $ this -> endPage = ( int ) $ endPage ; }
Calculates start and end page that will be shown in the middle of pager.
Calculates start and end page that will be shown in the middle of pager .