[eluser]hbr[/eluser]
Hi,
It's all in the subject. I've been trying since CI 1.6.
Here is my simple code:
My controller:
Code:
function my_submissions($page=1) {
$PAGE_SIZE = 10;
$this->load->model('Submission');
$this->Submission->rows = $PAGE_SIZE;
$this->Submission->offset = ( $page - 1 ) * $PAGE_SIZE ;
$submissions = $this->Submission->get_list();
$total = $this->Submission->get_count();
$this->load->library('pagination');
$config['base_url'] = config_item('index_page') . '/members/my_submissions';
$config['total_rows'] = $total;
$config['uri_segment'] = 3;
$config['per_page'] = $PAGE_SIZE;
$this->pagination->initialize($config);
$paging = $this->pagination->create_links();
[...]
}
Okay, now when loading page 1 (/members/my_submissions/1), the db record n#1 is loaded as expected, the pagination links apprear BUT page 2 is selected instead of page 1 as default page.
When hovering over page 1 link, the link points to /members/my_submissions/ without any page number.
Page 3 points to /members/my_submissions/2
Page 4 points to /members/my_submissions/3
and so on.
So any idea please?