问题
I make a pagination with Pagination Class of CodeIgniter and some tutorials, it work fine, but the problem is that after the page number 10 do not show the Last Page link.
My controller
$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);
My view
<?php foreach ($query->result() as $row) { ?>
<div><?php echo $row->norma; ?></div>
<?php } ?>
// Then I show the pagination links
<?php
foreach ($links as $link) {
?>
<li>
<?php echo $link ?>
</li>
<?php
}
?>
I have 26 pages in total, all shows OK, but in the page 11, and in the next one until 26 does not show the Last link
Thank´s in advance.
来源:https://stackoverflow.com/questions/45419996/pagination-last-link-disappeard-after-page-10