• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pagination dont show First and Last links and dont move between links numbers

#1
[eluser]Asinox[/eluser]
Hi, i dont know why is wrong with this pagination... but the pagination "is working" but dont show the links "First and Last" and dont move between numbers links... just the first number links (1 ) is select always in bold.

what is wrong?

Code:
//controller
function listar(){
        //paginacion
        $data['title'] = "MANEJAR COMENTARIOS | listar comentarios";
        $config['base_url'] = base_url().'index.php/adm/comentarios/listar/pagina';
        $config['total_rows'] = $this->ModComentarios->total();
        $config['per_page'] = '5';
        $config['full_tag_open'] = '<p>';    
        $config['full_tag_close'] = '</p>';
        $config['first_link'] = 'Inicio';
        $config['last_link'] = 'Final';
        $data['listar'] = $this->ModComentarios->listar($config['per_page'],$this->uri->segment(5));
        $this->pagination->initialize($config);
        //fin paginacion
        $data['main'] = "adm/admin_listar_comentarios";
        
        $this->load->vars($data);
        $this->load->view('adm/dashboard');
    }

Code:
//model
//listar todos los comentarios
    function listar($num,$offset){
        $this->db->select('*');
        $this->db->order_by("id_comment","DESC");
        $query = $this->db->get("comments",$num,$offset);
        return $query->result();
    }
    
    //contar todos los registros
    function total(){
        $this->db->select('*');
        $total = $this->db->get('comments');
        return $total->num_rows();
        
    }

Thansk

#2
[eluser]Asinox[/eluser]
no body? Sad

#3
[eluser]Sarfaraz Momin[/eluser]
Just try to include the following in your pagination config code

Code:
$config['uri_segment'] = 3;

This config should be the segment in the URI which has pagination information.

Have a good day !!!

#4
[eluser]Asinox[/eluser]
Thank's Broth Big Grin


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.