0

你好我有分页码

//$this->output->enable_profiler(TRUE);
 $this->load->library('pagination');
 $this->load->model('dbs');
$config['base_url'] = site_url('cp/my_walls/');
$config['per_page'] = 5; 
$config['num_links'] = 3;
$config['uri_segment'] = 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ;
$config['total_rows'] = $this->dbs->get_walls_count_by_user();
$this->pagination->initialize($config); 
$curr = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
        $data['title'] = 'User control Panel';
        $data['walls'] = $this->dbs->get_walls_by_user($config["per_page"],$curr); // get limited posts

我也有这个网址的路线

$route['cp/my_walls'] = "main/my_uploaded_wallpapers";
$route['cp/my_walls/(:any)'] = "main/my_uploaded_wallpapers/$1";

这是默认工作的,它的限制是 5 个帖子。

但是我在分页链接中单击第 2 页,它不再起作用

url: site.com/cp/my_walls     - working
url: site.com/cp/my_walls/10     - not working
4

2 回答 2

-1

尝试这个

 $route['news/(:num)'] = "news/index";  
于 2015-02-07T16:09:13.187 回答
-1

使用$this->uri->rsegment(n)代替$this->uri->segment(n)

于 2015-01-24T14:14:42.007 回答