Codeigniter分页突出显示当前链接首次

时间:2018-01-17 19:50:46

标签: codeigniter-3

我遇到了一个奇怪的问题,Codeigniter Pagination突出了当前链接第一个时的最后一个链接

$route['favorite/(:num)'] = 'user/favorite/$1';
$route['favorite/(:num)/page/(:num)'] = 'user/favorite/$1/$2';

$this->load->library('pagination');
$config['base_url'] = "/favorite/$user_fav_id/page";
$config['total_rows'] = $this->user_model->count_user_fav_all_movies($user_id, $user_fav_id);
$config['per_page'] = 3;
$config['use_page_numbers'] = true;
$config['first_link'] = 'в начало';
$config['last_link'] = 'в конец';
$config['next_link'] = '';
$config['prev_link'] = '';
$config['first_url'] = "/favorite/$user_fav_id";
$this->pagination->initialize($config);

1 个答案:

答案 0 :(得分:1)

您必须通过提供uri_segment

告诉CI您当前所在的页面
$config['uri_segment'] = $this->uri->total_segments();

$config['uri_segment'] = 4;