我只是需要帮助来定制codeigniter中的分页。我要使“之前”按钮和“第一个”按钮始终显示。仅当我在第二页上时才显示“之前”按钮,而当我在第三页上时才显示“第一”按钮。
图片2:在第2页上
我希望它始终像显示所有按钮的图像3一样显示。
这是我的代码:
$config["total_rows"] = $totalRecords;
$config["per_page"] = $limit;
$config['use_page_numbers'] = TRUE;
$config['page_query_string'] = TRUE;
$config['enable_query_strings'] = TRUE;
$config['num_links'] = 1;
$config['first_tag_open'] = '<li class="pg-links">';
$config['first_tag_close'] = '</li>';
$config['last_tag_open'] = '<li class="pg-links">';
$config['last_tag_close'] = '</li>';
$config['cur_tag_open'] = '<li class="pg-links activePage">';
$config['cur_tag_close'] = '</li>';
$config['prev_tag_open'] = '<li class="pg-links">';
$config['prev_tag_close'] = '</li>';
$config['next_tag_open'] = '<li class="pg-links">';
$config['next_tag_close'] = '</li>';
$config['num_tag_open'] = '<li class="pg-links">';
$config['num_tag_close'] = '</li>';
$this->pagination->initialize($config);
$str_links = $this->pagination->create_links();
$links = explode(' ', $str_links);
任何想法如何做到这一点?