Pagination Last link disappeard after page 10

蹲街弑〆低调 提交于 2020-01-24 21:24:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!