我对codeigniter分页的设置是这样的:
$this->load->library("pagination");
$config = array();
$config['base_url'] = site_url('page/stok');
$config['total_rows'] = $this->posting_model->count_all_stok();
$config['per_page'] = 10;
$config['uri_segment'] = 3;
$config['use_page_numbers'] = TRUE;
$this->pagination->initialize($config);
但是,如果我将鼠标悬停在第2页,我的页面网址会如何变成这样:
http://localhost:8080/pmm/page/stok/10
我在这里受到什么冤枉?
答案 0 :(得分:0)
如果您未在 config / config.php 中设置site_url()
,这就是base_url
的工作原理。尝试正确指定:$config['base_url'] = '//yoursite.com/';
。
答案 1 :(得分:0)
在加载分页库
之前将此行添加到控制器$config['uri_segment'] = 3; //or try 4