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

[已解决] 分页类出问题了

[复制链接]
发表于 2009-11-17 16:13:53 | 显示全部楼层 |阅读模式
PHP复制代码
public function category(){
        $this->load->library('pagination');
        $c = $this->uri->segment(3);
        $config['base_url'] = site_url("blog/category/$c");
        $config['total_rows'] = $this->article->get_article_category($c);
        //exit($config['total_rows']);
        $config['per_page'] = 2;
        $config['uir_segment'] = 4;
        $config['num_links'] = 3;
        $config['full_tag_open'] = '<p>';
        $config['full_tag_close'] = '</p>';
        //$config['page_query_string'] = TRUE;
        $this->pagination->initialize($config);
 
        $data['category'] = $this->category->get_by($c);
        $data['art_num'] = $config['total_rows'];
        $data['segment'] = $this->uri->segment(4,0);
 
 
        $data['article'] = $this->article->get_article_by_category($c,$config['per_page'],$this->uri->segment(4,0));
 
        $data['pagelinks'] = $this->pagination->create_links();
        $this->load->view('category',$data)
复制代码
s1.jpg
我的segment3是传了个分类id ,segment4是分页类用的。但分页条总是选中了片段三的数字。找了一个晚上还是没有发现哪里出错了
发表于 2009-11-17 17:11:17 | 显示全部楼层
$config['uir_segment'] = 4;
改成
$config['uri_segment'] = 4;
 楼主| 发表于 2009-11-17 17:31:54 | 显示全部楼层
谢谢HEX,我实在是太粗心大意了
发表于 2009-11-18 09:18:59 | 显示全部楼层
HEX大的眼睛果然不是盖的~
发表于 2009-11-18 11:12:22 | 显示全部楼层
一灯灭了万年黑!

本版积分规则