2015-11-27 56 views
0

這是我的分頁設置笨:分頁的笨還是未來eventhough只有一個頁面

$pagination_config = array(
     // pagination settings 
     'base_url' => site_url('lab/hasil_rawat_jalan'), 
     'total_rows' => $jawaban_lab->total_row(), 
     'suffix' => '?column=' . $column_name . '&value=' . $value, 
     'reuse_query_string' => FALSE, 
     'per_page' => $per_page, 
     // 'uri_segment' => 3, 
     'num_links' => floor(count($labs)/15), 
     // config for bootstrap pagination 
     'full_tag_open' => '<ul class="pagination">', 
     'full_tag_close' => '</ul>', 
     'first_link' => false, 
     'last_link' => false, 
     'first_tag_open' => '<li>', 
     'first_tag_close' => '</li>', 
     'prev_link' => '&laquo', 
     'prev_tag_open' => '<li class="prev">', 
     'prev_tag_close' => '</li>', 
     'next_link' => '&raquo', 
     'next_tag_open' => '<li>', 
     'next_tag_close' => '</li>', 
     'last_tag_open' => '<li>', 
     'last_tag_close' => '</li>', 
     'cur_tag_open' => '<li class="active"><a href="#">', 
     'cur_tag_close' => '</a></li>', 
     'num_tag_open' => '<li>', 
     'num_tag_close' => '</li>' 
    ); 

我的問題是,爲什麼分頁仍顯示鏈接到下一頁eventhough我設置「NUM_LINKS」爲0,這樣的:

enter image description here

如何刪除鏈接到下一個頁面?

+0

什麼呢'$ jawaban_lab-> total_row()'回報? –

+0

點擊下一步,是什麼引發? –

+0

@RejoanulAlam在jawaban_lab表中返回總排,我用1代替測試,但仍然是相同的 – stacheldraht27

回答

0

控制器

public function all_post() 
{ 
    $data = array(); 
    $this->load->library('pagination'); 
    $config['base_url'] = base_url() . 'lab/hasil_rawat_jalan/'; 
    $config['total_rows'] = $this->db->count_all('posts'); 
    $config['per_page'] = '6'; 
    $config['full_tag_open'] = '<ul class="pagination">'; 
    $config['full_tag_close'] = '</ul>'; 
    $config['first_link'] = false; 
    $config['last_link'] = false; 
    $config['first_tag_open'] = '<li>'; 
    $config['first_tag_close'] = '</li>'; 
    $config['prev_link'] = 'Prev'; 
    $config['prev_tag_open'] = '<li class="prev">'; 
    $config['prev_tag_close'] = '</li>'; 
    $config['next_link'] = 'Next'; 
    $config['next_tag_open'] = '<li>'; 
    $config['next_tag_close'] = '</li>'; 
    $config['last_tag_open'] = '<li>'; 
    $config['last_tag_close'] = '</li>'; 
    $config['cur_tag_open'] = '<li class="active"><a href="#">'; 
    $config['cur_tag_close'] = '</a></li>'; 
    $config['num_tag_open'] = '<li>'; 
    $config['num_tag_close'] = '</li>'; 
    $this->pagination->initialize($config); 
    $data['all_blogs']=$this->w_model->view_publish_blog($config['per_page'], $this->uri->segment(4)); 
    $data['maincontent'] = $this->load->view('cat_content',$data, true); 
    $this->load->view('home', $data); 
} 

型號

function view_publish_blog($per_page, $offset){ 
    $this->db->select('*'); 
    $this->db->from('posts'); 
    $this->db->where('status',1); 
    $this->db->order_by('post_id','desc'); 
    $query_result=$this->db->get('', $per_page, $offset); 
    $result=$query_result->result(); 
    return $result; 
}