doutuo1939 2014-10-08 10:35
浏览 23
已采纳

更改base_url分页CodeIgniter

I'm coding the pagination from a web, but now I have a problem my pagination give me this url: www.site.com/published/getClients/5 But I need to change to www.site.com/published/getClients/5/2/1 (The first number is the pagination offset). This is my code:

    $limit = 5;
    $config['base_url'] = base_url().'published/getClients/';
    $config['total_rows'] = $this->db->get('client')->num_rows();
    $config['per_page'] = $limit;
    $config['uri_segment'] = '3';
    $this->pagination->initialize($config);

So how can If the last two numbers at last?, something like this($offset is the number 5 from the pagination):

    $config['base_url'] = base_url().'published/getClients/'.$offset.'/'.$idState.'/'.$idCountry;

Please help!.

  • 写回答

1条回答 默认 最新

  • dongquan8753 2014-10-08 10:44
    关注

    Do like the below

    $limit = 5;
    $config['base_url'] = base_url().'published/getClients/5/2';
    $config['total_rows'] = $this->db->get('client')->num_rows();
    $config['per_page'] = $limit;
    $config['uri_segment'] = '5';
    $this->pagination->initialize($config);
    

    Just you have to pass the additional parameters after the function name and then the pagination number and after you have to change the uri_segment to 5 since at that position now the page number will come.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?