public function generatePageLinks($url, $currentPage, $lastPage, $options = array()) {
        //Handle the options array
        $idTemplate = (isset($options['idTemplate']) && null != $options['idTemplate']) ? $options['idTemplate'] : null;
        $classes = (isset($options['classes']) && null != $options['classes']) ? $options['classes'] : array();
        $currentPageClass = (isset($options['currentPageClass']) && null != $options['currentPageClass']) ? $options['currentPageClass'] : '';

        //Generates links in the following pattern [1] 2 3 10 ... last
        // 1 ... 5 14 [15] 16 25 ... last
        $this->links->push($this->createPageLink($url, 1, $currentPage, $idTemplate, $classes, $currentPageClass));
        if ($currentPage - 2 > 1) {
            $firstBreak = new PageLink('...');
            $firstBreak->setDisabled(true);
            $this->links->push($firstBreak);
        }
        if ($currentPage - 10 > 1) {
            $this->links->push($this->createPageLink($url, $currentPage - 10, $currentPage, $idTemplate, $classes, $currentPageClass));
        }
        if ($currentPage - 1 > 1) {
            $this->links->push($this->createPageLink($url, $currentPage - 1, $currentPage, $idTemplate, $classes, $currentPageClass));
        }
        if ($currentPage > 1) {
            $this->links->push($this->createPageLink($url, $currentPage, $currentPage, $idTemplate, $classes, $currentPageClass));
        }
        if ($currentPage + 1 < $lastPage) {
            $this->links->push($this->createPageLink($url, $currentPage + 1, $currentPage, $idTemplate, $classes, $currentPageClass));
        }
        if ($currentPage + 10 < $lastPage) {
            $this->links->push($this->createPageLink($url, $currentPage + 10, $currentPage, $idTemplate, $classes, $currentPageClass));
        }
        if ($currentPage + 2 < $lastPage) {
            $lastBreak = new PageLink('...');
            $lastBreak->setDisabled(true);
            $this->links->push($lastBreak);
        }
        if ($currentPage < $lastPage) {
            $this->links->push($this->createPageLink($url, $lastPage, $currentPage, $idTemplate, $classes, $currentPageClass));
        }

        //return self
        return $this;
    }
public function generatePageLinks($url, $currentPage, $lastPage, $options = array()) {
        //Handle the options array
        $idTemplate = (isset($options['idTemplate']) && null != $options['idTemplate']) ? $options['idTemplate'] : null;
        $classes = (isset($options['classes']) && null != $options['classes']) ? $options['classes'] : array();
        $currentPageClass = (isset($options['currentPageClass']) && null != $options['currentPageClass']) ? $options['currentPageClass'] : '';

        //Generates links in the following pattern [1] 2 3 10 ... last
        // 1 ... 5 14 [15] 16 25 ... last
        $this->links->push($this->createPageLink($url, 1, $currentPage, $idTemplate, $classes, $currentPageClass));
        if ($currentPage - 2 > 1) {
            $firstBreak = new PageLink('...');
            $firstBreak->setDisabled(true);
            $this->links->push($firstBreak);
        }
        if ($currentPage - 10 > 1) {
            $this->links->push($this->createPageLink($url, $currentPage - 10, $currentPage, $idTemplate, $classes, $currentPageClass));
        }
        if ($currentPage - 1 > 1) {
            $this->links->push($this->createPageLink($url, $currentPage - 1, $currentPage, $idTemplate, $classes, $currentPageClass));
        }
        if ($currentPage > 1) {
            $this->links->push($this->createPageLink($url, $currentPage, $currentPage, $idTemplate, $classes, $currentPageClass));
        }
        if ($currentPage + 1 < $lastPage) {
            $this->links->push($this->createPageLink($url, $currentPage + 1, $currentPage, $idTemplate, $classes, $currentPageClass));
        }
        if ($currentPage + 10 < $lastPage) {
            $this->links->push($this->createPageLink($url, $currentPage + 10, $currentPage, $idTemplate, $classes, $currentPageClass));
        }
        if ($currentPage + 2 < $lastPage) {
            $lastBreak = new PageLink('...');
            $lastBreak->setDisabled(true);
            $this->links->push($lastBreak);
        }
        if ($currentPage < $lastPage) {
            $this->links->push($this->createPageLink($url, $lastPage, $currentPage, $idTemplate, $classes, $currentPageClass));
        }

        //return self
        return $this;
    }
public function generatePageLinks ( $ url , $ currentPage , $ lastPage , $ options = array ( ) ) { //Handle the options array $ idTemplate = ( isset ( $ options [ 'idTemplate' ] ) && null != $ options [ 'idTemplate' ] ) ? $ options [ 'idTemplate' ] : null ; $ classes = ( isset ( $ options [ 'classes' ] ) && null != $ options [ 'classes' ] ) ? $ options [ 'classes' ] : array ( ) ; $ currentPageClass = ( isset ( $ options [ 'currentPageClass' ] ) && null != $ options [ 'currentPageClass' ] ) ? $ options [ 'currentPageClass' ] : '' ; //Generates links in the following pattern [1] 2 3 10 ... last // 1 ... 5 14 [15] 16 25 ... last $ this -> links -> push ( $ this -> createPageLink ( $ url , 1 , $ currentPage , $ idTemplate , $ classes , $ currentPageClass ) ) ; if ( $ currentPage - 2 > 1 ) { $ firstBreak = new PageLink ( '...' ) ; $ firstBreak -> setDisabled ( true ) ; $ this -> links -> push ( $ firstBreak ) ; } if ( $ currentPage - 10 > 1 ) { $ this -> links -> push ( $ this -> createPageLink ( $ url , $ currentPage - 10 , $ currentPage , $ idTemplate , $ classes , $ currentPageClass ) ) ; } if ( $ currentPage - 1 > 1 ) { $ this -> links -> push ( $ this -> createPageLink ( $ url , $ currentPage - 1 , $ currentPage , $ idTemplate , $ classes , $ currentPageClass ) ) ; } if ( $ currentPage > 1 ) { $ this -> links -> push ( $ this -> createPageLink ( $ url , $ currentPage , $ currentPage , $ idTemplate , $ classes , $ currentPageClass ) ) ; } if ( $ currentPage + 1 < $ lastPage ) { $ this -> links -> push ( $ this -> createPageLink ( $ url , $ currentPage + 1 , $ currentPage , $ idTemplate , $ classes , $ currentPageClass ) ) ; } if ( $ currentPage + 10 < $ lastPage ) { $ this -> links -> push ( $ this -> createPageLink ( $ url , $ currentPage + 10 , $ currentPage , $ idTemplate , $ classes , $ currentPageClass ) ) ; } if ( $ currentPage + 2 < $ lastPage ) { $ lastBreak = new PageLink ( '...' ) ; $ lastBreak -> setDisabled ( true ) ; $ this -> links -> push ( $ lastBreak ) ; } if ( $ currentPage < $ lastPage ) { $ this -> links -> push ( $ this -> createPageLink ( $ url , $ lastPage , $ currentPage , $ idTemplate , $ classes , $ currentPageClass ) ) ; } //return self return $ this ; }
Generates an array of page link objects using a url template and the current page number and stores them in this object

@param  string $url         The url with a '!page!' substring to replace with the page number
@param  int    $currentPage The current page
@param  int    $lastPage    The last page of the report
@param  array  $options     The options array
idTemplate: string with a '!page!' substring to use to replace with the page number
if no id template is given, id attributes are NOT added to the tags
classes: array of classes to add to the classes atrribute
currentPageClass: class name to give to the tag that holds the current class

@return self
Generates an array of page link objects using a url template and the current page number and stores them in this object