src/Pagination.php
public function init($config)
    {
        // init init error
        //default
        $this->config['per_page']       = 10;
        $this->config['item_to_show']   = 2;
        $this->config['skip_item']      = true;
        
        $this->config['first_tag_open'] = "<li>";
        $this->config['first_tag_close']= "</li>";
        
        $this->config['last_tag_open']  = "<li>";
        $this->config['last_tag_close'] = "</li>";
        
        $this->config['prev_tag_open']  = "<li>";
        $this->config['prev_tag_close'] = "</li>";
        $this->config['prev_tag_text']  = "Prev";
        
        $this->config['next_tag_open']  = "<li>";
        $this->config['next_tag_close'] = "</li>";
        $this->config['next_tag_text']  = "Next";
        
        $this->config['cur_tag_open']   = "<li class='active'>";
        $this->config['cur_tag_close']  = "</li>";

        $this->config['link_attribute'] = "class=''";
        $this->config['link_attribute_active'] = "class='active'";
        
        $this->config['num_tag_open']   = "<li>";
        $this->config['num_tag_close']  = "</li>";

        $this->config['skip_tag_open']  = "<li>";
        $this->config['skip_tag_close'] = "</li>";
        $this->config['skip_tag_text']  = "<a href='#'>....</a>";
        $this->config['start_page']     = 0;

        //merge options
        foreach ($config as $key => $value) {
            $this->config[$key]=$value;
        }
        if($this->config['item_to_show']<2)
            $this->config['item_to_show']=2;

        $this->total = intval($config['rows']);
        $this->per_page = intval($config['per_page']);
        $this->current_page = intval($config['current_page']) ;
        $this->base_url = urldecode($config['base_url']);
    }
public function init($config)
    {
        // init init error
        //default
        $this->config['per_page']       = 10;
        $this->config['item_to_show']   = 2;
        $this->config['skip_item']      = true;
        
        $this->config['first_tag_open'] = "<li>";
        $this->config['first_tag_close']= "</li>";
        
        $this->config['last_tag_open']  = "<li>";
        $this->config['last_tag_close'] = "</li>";
        
        $this->config['prev_tag_open']  = "<li>";
        $this->config['prev_tag_close'] = "</li>";
        $this->config['prev_tag_text']  = "Prev";
        
        $this->config['next_tag_open']  = "<li>";
        $this->config['next_tag_close'] = "</li>";
        $this->config['next_tag_text']  = "Next";
        
        $this->config['cur_tag_open']   = "<li class='active'>";
        $this->config['cur_tag_close']  = "</li>";

        $this->config['link_attribute'] = "class=''";
        $this->config['link_attribute_active'] = "class='active'";
        
        $this->config['num_tag_open']   = "<li>";
        $this->config['num_tag_close']  = "</li>";

        $this->config['skip_tag_open']  = "<li>";
        $this->config['skip_tag_close'] = "</li>";
        $this->config['skip_tag_text']  = "<a href='#'>....</a>";
        $this->config['start_page']     = 0;

        //merge options
        foreach ($config as $key => $value) {
            $this->config[$key]=$value;
        }
        if($this->config['item_to_show']<2)
            $this->config['item_to_show']=2;

        $this->total = intval($config['rows']);
        $this->per_page = intval($config['per_page']);
        $this->current_page = intval($config['current_page']) ;
        $this->base_url = urldecode($config['base_url']);
    }
public function init ( $ config ) { // init init error //default $ this -> config [ 'per_page' ] = 10 ; $ this -> config [ 'item_to_show' ] = 2 ; $ this -> config [ 'skip_item' ] = true ; $ this -> config [ 'first_tag_open' ] = "<li>" ; $ this -> config [ 'first_tag_close' ] = "</li>" ; $ this -> config [ 'last_tag_open' ] = "<li>" ; $ this -> config [ 'last_tag_close' ] = "</li>" ; $ this -> config [ 'prev_tag_open' ] = "<li>" ; $ this -> config [ 'prev_tag_close' ] = "</li>" ; $ this -> config [ 'prev_tag_text' ] = "Prev" ; $ this -> config [ 'next_tag_open' ] = "<li>" ; $ this -> config [ 'next_tag_close' ] = "</li>" ; $ this -> config [ 'next_tag_text' ] = "Next" ; $ this -> config [ 'cur_tag_open' ] = "<li class='active'>" ; $ this -> config [ 'cur_tag_close' ] = "</li>" ; $ this -> config [ 'link_attribute' ] = "class=''" ; $ this -> config [ 'link_attribute_active' ] = "class='active'" ; $ this -> config [ 'num_tag_open' ] = "<li>" ; $ this -> config [ 'num_tag_close' ] = "</li>" ; $ this -> config [ 'skip_tag_open' ] = "<li>" ; $ this -> config [ 'skip_tag_close' ] = "</li>" ; $ this -> config [ 'skip_tag_text' ] = "<a href='#'>....</a>" ; $ this -> config [ 'start_page' ] = 0 ; //merge options foreach ( $ config as $ key => $ value ) { $ this -> config [ $ key ] = $ value ; } if ( $ this -> config [ 'item_to_show' ] < 2 ) $ this -> config [ 'item_to_show' ] = 2 ; $ this -> total = intval ( $ config [ 'rows' ] ) ; $ this -> per_page = intval ( $ config [ 'per_page' ] ) ; $ this -> current_page = intval ( $ config [ 'current_page' ] ) ; $ this -> base_url = urldecode ( $ config [ 'base_url' ] ) ; }
Initialize pagination config
@param array $config
Initialize pagination config