Zepi/Web/UserInterface/src/Renderer/Pagination.php
protected function addPages(PaginationObject $pagination, $activePage, $neededPages)
    {
        // Add the pages
        for ($i = 1; $i <= $neededPages; $i++) {
            if ($i == $activePage) {
                $page = new ActivePage($i, $this->buildUrl($i));
                $pagination->addEntry($page);
            } else if ($i < 4 || $i > ($neededPages - 3) || ($i > ($activePage - 3) && $i < ($activePage + 3))) {
                $page = new Page($i, $this->buildUrl($i));
                $pagination->addEntry($page);
            } else if (!($pagination->getLatestEntry() instanceof Dots)) {
                $dots = new Dots();
                $pagination->addEntry($dots);
            }
        }
    }
protected function addPages(PaginationObject $pagination, $activePage, $neededPages)
    {
        // Add the pages
        for ($i = 1; $i <= $neededPages; $i++) {
            if ($i == $activePage) {
                $page = new ActivePage($i, $this->buildUrl($i));
                $pagination->addEntry($page);
            } else if ($i < 4 || $i > ($neededPages - 3) || ($i > ($activePage - 3) && $i < ($activePage + 3))) {
                $page = new Page($i, $this->buildUrl($i));
                $pagination->addEntry($page);
            } else if (!($pagination->getLatestEntry() instanceof Dots)) {
                $dots = new Dots();
                $pagination->addEntry($dots);
            }
        }
    }
protected function addPages ( PaginationObject $ pagination , $ activePage , $ neededPages ) { // Add the pages for ( $ i = 1 ; $ i <= $ neededPages ; $ i ++ ) { if ( $ i == $ activePage ) { $ page = new ActivePage ( $ i , $ this -> buildUrl ( $ i ) ) ; $ pagination -> addEntry ( $ page ) ; } else if ( $ i < 4 || $ i > ( $ neededPages - 3 ) || ( $ i > ( $ activePage - 3 ) && $ i < ( $ activePage + 3 ) ) ) { $ page = new Page ( $ i , $ this -> buildUrl ( $ i ) ) ; $ pagination -> addEntry ( $ page ) ; } else if ( ! ( $ pagination -> getLatestEntry ( ) instanceof Dots ) ) { $ dots = new Dots ( ) ; $ pagination -> addEntry ( $ dots ) ; } } }
Add the pages to the pagination

@param \Zepi\Web\UserInterface\Pagination\Pagination $pagination
@param integer $activePage
@param integer $neededPages
Add the pages to the pagination