用户
 找回密码
 入住 CI 中国社区
搜索
查看: 5962|回复: 3
收起左侧

[分页] 分页类中的一个小bug

  [复制链接]
发表于 2010-8-15 16:07:27 | 显示全部楼层 |阅读模式
分页类126-145行
PHP复制代码
  if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)
  {
   if ($CI->input->get($this->query_string_segment) != 0)
   {
    $this->cur_page = $CI->input->get($this->query_string_segment);
    // Prep the current page - no funny business!
    $this->cur_page = (int) $this->cur_page;
   }
  }
  else
  {
   if ($CI->uri->segment($this->uri_segment) != 0)
   {
    $this->cur_page = $CI->uri->segment($this->uri_segment);
    // Prep the current page - no funny business!
    $this->cur_page = (int) $this->cur_page;
   }
  }
复制代码


else 语句中 $CI->uri->segment 应该改为 $CI->uri->rsegment,否则如果使用路由重写则分页不能正确指向当前分类,
追踪这个错误花费了我一些时间

评分

参与人数 1威望 +5 收起 理由
kuailewang + 5 很给力!

查看全部评分

发表于 2010-10-24 15:36:50 | 显示全部楼层
哦,[img][/img]

评分

参与人数 1威望 -2 收起 理由
Hex -2 违反版规

查看全部评分

发表于 2013-3-27 09:36:03 | 显示全部楼层
这个很有键值的神贴竟然没有人顶!
发表于 2017-11-4 17:55:40 | 显示全部楼层
        508行 新版本ci框架                $this->cur_page = $this->CI->uri->rsegment($this->uri_segment);

本版积分规则