[eluser]Bramme[/eluser]
You don't have to do that xwero...
Code:
$total_rows = $query->num_rows();
$per_page = 5;
$pagination_config['base_url'] = 'http://www.mickm.com/'.$type.'/offset/';
$pagination_config['total_rows'] = $total_rows;
$pagination_config['per_page'] = $per_page;
$this->pagination->initialize($pagination_config);
This is an example directly from a controller of mine. And then I have a config item too.
pagination.php:
Code:
<?php
$config['full_tag_open'] = '<p id="pagination">';
$config['full_tag_close'] = '</p>';
$config['num_links'] = 3;
$config['first_link'] = ' |< First ';
$config['prev_link'] = ' < Prev ';
$config['next_link'] = ' Next > ';
$config['last_link'] = ' Last >| ';
$config['first_tag_open'] = '';
$config['first_tag_close'] = '';
$config['last_tag_open'] = '';
$config['last_tag_close'] = '';
$config['cur_tag_open'] = '<span>';
$config['cur_tag_close'] = '</span>';
$config['next_tag_open'] = '';
$config['next_tag_close'] = '';
$config['prev_tag_open'] = '';
$config['prev_tag_close'] = '';
$config['num_tag_open'] = '';
$config['num_tag_close'] = '';
?>
Works like a charm!
Mind you, you do have to set some config items in your controller now, but personally I don't mind... I only put stuff in config files if it's the same for the entire site.