Welcome Guest, Not a member yet? Register   Sign In
Pagination problem
#1

[eluser]philstan[/eluser]
Pagination is giving me problems (again)..sigh.

Here is the relevant code:

Code:
$per_page = 10;
            $config['base_url'] = site_url('account/messages/p');
            $config['total_rows'] = $this->messaging_model->get_all_messages_count($this->dx_auth->get_user_id());
            $config['per_page'] = $per_page;
            $config['first_link'] = 'First';
            $config['last_link'] = 'Last';
            $config['next_link'] = 'next';
            $config['prev_link'] = 'prev';

            $this->pagination->initialize($config);
            
            $data['all_messages'] = $this->messaging_model->get_all_messages($this->dx_auth->get_user_id(), $per_page, $this->uri->segment(4));

This works well on the first page, highlighting page 1 and giving me the subsequent links and "next". However when I click on the subsequent pages, page 1 is still highlighted and there is no "previous" ALTHOUGH the correct content is displayed for that page.

example:

on page 1 = 1,2,3 next - This is correct

on page 2 = 1,2,3 next - Should be = prev 1,2,3 next

on page 3 = 1,2,3 next - Should be = prev 1,2,3 next

Anybody have an idea what I am doing wrong?

Thanks
#2

[eluser]philstan[/eluser]
Solved!

I'm an idiot. :-(

I forgot to add this:

Code:
$config[‘uri_segment’] = 4;

Thanks
#3

[eluser]saidai jagan[/eluser]
Most of them are !! Wink




Theme © iAndrew 2016 - Forum software by © MyBB