1
votes

i have this problem where in the 1st page has no link like base_url/controller/function/page_number.. please see the screenshot below

enter image description here

but when i inspected the element on the "1" page i only see this link

enter image description here

now my problem is that while all other links has a page number, why does "1" doesn't have one, it will mess up my routes.

Here is my config for the pagination..

My controller

public function testaccounts($params = FALSE)
{

    $this->load->library('pagination');
    $this->load->library('table');

    $config['base_url'] = base_url().'accounts/test';
    $config['total_rows'] = 200;
    $config['per_page'] = 5;
    $config['num_links'] = 20;
    $config['use_page_numbers'] = TRUE;

    $this->pagination->initialize($config);

    $this->load->view('testaccounts');
}

and my view contains only create_link() function to display the pagination.

1

1 Answers

2
votes

Adding:

$config['first_url'] = '1';

Should fix it so it doesn't have the link to test/ for page one, rather it will force it to go to test/1