|
我用CI的分页类在控制器中的代码如下
$config['total_rows']=$this->Mhome->get_allrows($this->uri->segment(3));
$config['base_url']=base_url().'index.php/home/category/'.$this->uri->segment(3);
$config['pre_page']=2;
$config['uri_segment']=4;
$config['full_tag_open']='<p>';
$config['full_tag_close']='</p>';
$config['first_link']='第一页';
$config['last_link']='最后一页';
$config['next_link']='下一页';
$config['prev_link']='上一页';
$config['num_links']=2;
$this->pagination->initialize($config);
$data['article']=$this->Mhome->get_page($this->uri->segment(3),$this->uri->segment(4,0),$config['pre_page']);
在视图中
<?php echo $this->pagination->create_links()?>
结果在视图中显示不出来分页的相关内容;我看了手册,但还是不知道是怎么回事,程序也没有报错,但是直接在地址栏中的URI段中输入页码时,视图的内容又也会显示相应页的内容,这是为什么啊?我是CI新手,求助啊!3QU了
|
|