我的分页不起作用(Codeigniter)

时间:2016-01-09 05:48:49

标签: php codeigniter pagination

我的分页不起作用。我不知道如何解决它。
问题是每当我点击第二页时,该值甚至不会改变URL。
这是我的控制器代码

['X-DSPAM-Confidence:', '0.9846']

我的型号代码

    $data['topic'] = $this->Model_forum->get_topic_per_category(5,$start,$cat); // start= 0 
    $config['base_url'] = base_url().'Forum/forum_per_category/'.$cat.'/';
    $config['total_rows']= $this->Model_forum->count_topic($cat);
    $config['per_page']=5;
    $config['full_tag_open'] = '<ul class="pager">';
    $config['full_tag_close'] = '</ul>';
    $config['next_link'] = 'Next &rarr;';
    $config['next_tag_open'] = '<li class="next page">';
    $config['next_tag_close'] = '</li>';
    $config['prev_link'] = '&larr; Previous';
    $config['prev_tag_open'] = '<li class="prev page" ">';
    $config['prev_tag_close'] = '</li>';
    $config['cur_tag_open'] = '<li class="active"><a href="">';
    $config['cur_tag_close'] = '</a></li>';
    $config['num_tag_open'] = '<li class="page">';
    $config['num_tag_close'] = '</li>';
    $this->pagination->initialize($config);
    $data['pages'] = $this->pagination->create_links();
    $data['category'] = $this->Model_forum->get_category($cat);
    $this->load->view('forum_per_category',$data);
    $this->load->view('includes/footer');

1 个答案:

答案 0 :(得分:0)

在分页库中添加配置值

$config['uri_segment'] = 4;

然后你得到结果