我对CodeIgniter的分页类和一些教程进行了分页,它工作正常,但问题是在页码10之后没有显示最后一页链接。
我的控制器
$select_per_page = 5;
if ($this->session->userdata('cantidad')) {
$select_per_page = $this->session->userdata('cantidad');
}
$obj = new General();
// (BEGIN) Pagination//
$config['base_url'] = base_url('test/Gestionar_Test/');
$config['per_page'] = $select_per_page;
$config['num_links'] = 4;
$config["total_rows"] = $this->db->get('normas')->num_rows();
$inicio = $this->uri->segment(3);
$data['query'] = $query_lista_norma = $obj->Searcher_Norma($select_per_page, $inicio);
$this->pagination->initialize($config);
$str_links = $this->pagination->create_links();
$data["links"] = explode(' ', $str_links);
// (END) Pagination//
$data['pagination_view'] = 'contents/General_Content/pagination_view';
$data['contents'] = 'contents/test';
$this->load->view('template', $data);
我的观点
<?php foreach ($query->result() as $row) { ?>
<div><?php echo $row->norma; ?></div>
<?php } ?>
//然后我会显示分页链接
<?php
foreach ($links as $link) {
?>
<li>
<?php echo $link ?>
</li>
<?php
}
?>
我总共有26页,所有节目都显示正常,但在页面 11 ,在下一页中直到26不显示最后一个链接
提前感谢。