protected function buildCentered($squeezeTo, $numberOfPages)
    {
        $pages = $this->newPages($numberOfPages);

        $midLength = $squeezeTo - 2;
        $midOffset = $this->currentPageNumber - $midLength/2;

        $this->addPages($pages, 1, 1);
        $this->addPlaceHolder($pages);

        $this->addPages($pages, $midOffset, $midOffset+$midLength-1);

        $this->addPlaceHolder($pages);

        $this->addPages($pages, $numberOfPages, $numberOfPages);

        return $pages;
    }
protected function buildCentered($squeezeTo, $numberOfPages)
    {
        $pages = $this->newPages($numberOfPages);

        $midLength = $squeezeTo - 2;
        $midOffset = $this->currentPageNumber - $midLength/2;

        $this->addPages($pages, 1, 1);
        $this->addPlaceHolder($pages);

        $this->addPages($pages, $midOffset, $midOffset+$midLength-1);

        $this->addPlaceHolder($pages);

        $this->addPages($pages, $numberOfPages, $numberOfPages);

        return $pages;
    }
protected function buildCentered ( $ squeezeTo , $ numberOfPages ) { $ pages = $ this -> newPages ( $ numberOfPages ) ; $ midLength = $ squeezeTo - 2 ; $ midOffset = $ this -> currentPageNumber - $ midLength / 2 ; $ this -> addPages ( $ pages , 1 , 1 ) ; $ this -> addPlaceHolder ( $ pages ) ; $ this -> addPages ( $ pages , $ midOffset , $ midOffset + $ midLength - 1 ) ; $ this -> addPlaceHolder ( $ pages ) ; $ this -> addPages ( $ pages , $ numberOfPages , $ numberOfPages ) ; return $ pages ; }
Build a paginator squeezed to the center. Many pages in the center will
be visible and just 1 at the start and one at the end.

@param int $squeezeTo
@param int $numberOfPages

@return Pages
Build a paginator squeezed to the center . Many pages in the center will be visible and just 1 at the start and one at the end .