⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

link in pagination does not work



mbmtnez

mbmtnez
  • profile picture
  • Member

Posted 27 June 2017 - 14:09 PM

I am trying to make a pagination and I almost get it, but when I change one page to another (click page 1, later click page 2) does not work, but when I do manually it works. That is becouse when I click in the links in my browser show this:&page=40, and manually I only put the 40. I do not know why is that.

this is my Controller

function Test ($value){
if($value =='1')
   {
$config['per_page'] = 20;
$config['num_links'] = 10;
$config["total_rows"] = $this->db->get('normas')->num_rows();
$data['query'] = $this->db->get('normas', $config['per_page'], $this->uri->segment(4));
$this->pagination->initialize($config);
$data["links"] = $this->pagination->create_links();
(...)
  }
}

My view

<?php 
foreach ($query->result() as $row) {
echo '<p>'. $row->norma.'</p>';
}
echo $links;
?>

Please help!!, thanks in advance.