CodeIgniter Forums
Next and Previous Pagination - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Next and Previous Pagination (/showthread.php?tid=52642)



Next and Previous Pagination - El Forum - 06-19-2012

[eluser]rafi_ccj[/eluser]
i have a page where a list of items will be displayed. when i will click on any single item there will be details of that single item. now i am trying to use next and previous of pagination to go to the next item details or previous item details. but it is not working....how to do it?


my code is below.
Code:
$this->load->library('pagination');
        $config['base_url'] = base_url() . 'url/url';
        $config['total_rows'] = $this->myMODEL->function();
        $config['display_pages'] = FALSE;
        $config['first_link'] = FALSE;
        $config['last_link'] = FALSE;
        $config['next_link'] = 'Next';
        $config['next_tag_open'] = '<div>';
        $config['next_tag_close'] = '</div>';
        $config['prev_link'] = 'Previous';
        $config['prev_tag_open'] = '<div>';
        $config['prev_tag_close'] = '</div>';
        $config['uri_segment'] = 5;
        $config['num_links'] = 5;
        $config['per_page'] = 1;
        $this->pagination->initialize($config);



Next and Previous Pagination - El Forum - 06-19-2012

[eluser]Sanjay Sarvaiya[/eluser]
First of all you have to load pagination library for pagination
Code:
$this->load->library('pagination');
after that initialize you settings and define per page items as
Code:
$config['per_page'] = 20;
.


during pagination have you got any error?