Using pagination |
Thank you for your response,
here is the code example by CodeIgniter: (with my own comments) // I get this bit, just loading up the required library $this->load->library('pagination'); // I get this bit, setting some params $config['base_url'] = 'http://example.com/index.php/test/page/'; $config['total_rows'] = 200; $config['per_page'] = 20; // I get this bit, calls the pagination method and passes the array of params over (I assume) $this->pagination->initialize($config); // I don't get where to put this bit, my view doesn't instantiate an instance of the pagination class and if I put it in my controller it would just print it in the top of the page instead of passing it to the view and putting it in it's correct location, this is the bit I'm confused about echo $this->pagination->create_links(); Currently my controller looks like this: public function index() { $data['jobs'] = $this->jobs_model->get_jobs(); $data['title'] = 'jobs archive'; $this->load->library('pagination'); $config['base_url'] = 'http://codeigniter.local/jobs/index'; $config['total_rows'] = 200; $config['per_page'] = 20; $this->pagination->initialize($config); // Where do I put this? echo $this->pagination->create_links(); $this->load->view('templates/header', $data); $this->load->view('jobs/index', $data); $this->load->view('templates/footer'); } |
Messages In This Thread |
Using pagination - by barrypoore - 03-12-2018, 01:36 PM
RE: Using pagination - by jreklund - 03-13-2018, 01:32 AM
RE: Using pagination - by barrypoore - 03-13-2018, 11:12 AM
RE: Using pagination - by jreklund - 03-13-2018, 11:33 AM
RE: Using pagination - by barrypoore - 03-13-2018, 11:47 AM
RE: Using pagination - by jreklund - 03-13-2018, 01:11 PM
|