Paging in codeigniter 3

0

I made the pagination in the codeigniter and it works with exception of a detail the page link two gets url / 1, page three gets url / 2 and the first only the url. What do I do to make page two with url / 2? Here is the code:

$config = array();
    $config["base_url"] = base_url() . "usuarios";
    $config["total_rows"] = $this->usuario->totalRegistros();
    $config["per_page"] = $this->config->item('registros_por_pagina');
    $config["uri_segment"] = 2;
    $this->pagination->initialize($config);

    $pagina = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;

    $data['usuarios'] = $this->usuario->listarUsuarios($config["per_page"], $pagina);
    $data["paginacao"] = $this->pagination->create_links();

Thank you

    
asked by anonymous 09.08.2015 / 02:51

1 answer

0
$config ['use_page_numbers'] = TRUE;

Put this in your code.

    
26.10.2015 / 13:26