CodeIgniter Forums
Pagination dont show First and Last links and dont move between links numbers - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Pagination dont show First and Last links and dont move between links numbers (/showthread.php?tid=11687)



Pagination dont show First and Last links and dont move between links numbers - El Forum - 09-19-2008

[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


Pagination dont show First and Last links and dont move between links numbers - El Forum - 09-19-2008

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


Pagination dont show First and Last links and dont move between links numbers - El Forum - 09-19-2008

[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 !!!


Pagination dont show First and Last links and dont move between links numbers - El Forum - 09-19-2008

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