Reputation: 2421
i have this problem where in the 1st page has no link like base_url/controller/function/page_number.. please see the screenshot below
but when i inspected the element on the "1" page i only see this link
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.
Upvotes: 1
Views: 1053
Reputation: 4736
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
Upvotes: 2