Codeigniter Pagination class with bullets and images in the navigation


/ Published in: PHP
Save to your folder(s)

The standard codeigniter pagination class doesn't allow you to use images in the pagination navigation. I altered the default pagination class a bit. Now you can add the path to the images for the previous link, next link, digit and active digit in extra config parameters like so:

$this->load->library('pagination');
$config['base_url'] = base_url();
$config['total_rows'] = $this->your_model->select_items();
$config['per_page'] = '4';
$config['num_links'] = 10;
$config['full_tag_open'] = '';
$config['full_tag_close'] = '</p>';
$config['cur_page'] = $this->uri->segment(4);
//$config['cur_tag_open'] = "";
//$config['cur_tag_close'] = '';
$config['prev_link'] = "";
$config['next_link'] = "";
$config['digit'] = "";
$config['digit_active'] = "";

$this->pagination->initialize($config);
$this->mysmarty->assign("PAGINATION", $this->pagination->create_links());

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.