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.

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

报告相同问题?

悬赏问题

  • ¥15 phython如何实现以下功能?查找同一用户名的消费金额合并—
  • ¥15 孟德尔随机化怎样画共定位分析图
  • ¥18 模拟电路问题解答有偿速度
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址