【发布时间】:2012-04-27 22:10:50
【问题描述】:
据我所见,CodeIgniter 的分页计数错误,因为我的分页看起来像这样:
1 2 3 >
很好,问题出在每个分页号的url中,除了第一个:
分页中的数字 2 具有以下网址:
而数字3的网址如下:
所以,URL的数字每次减1。
我该如何解决这个问题,所以 url 中的页码将与分页中的页码相同?
我的分页配置:
$config['per_page'] = 5;
$config['base_url'] = site_url('page');
$config['uri_segment'] = 2;
$page = $this->uri->segment(2);
$total_rows_array = $this->records->get($config['per_page'], $page * $config['per_page']); // parameters: limit, offset.
$config['total_rows'] = count($total_rows_array);
【问题讨论】:
标签: php codeigniter pagination