Welcome Guest, Not a member yet? Register   Sign In
Initialising the pagination library part from config file, part within class
#1

[eluser]Unknown[/eluser]
I'm trying to initialise a my pagination links to be set up against a configuration which is partially stored in file (for the html etc) and partially within the calling controller.

My config/pagination.php looks like this:
Code:
$config['full_tag_open'] = '<div class="pagination"><ul>';
$config['full_tag_close'] = '</ul></div>';
$config['next_tag_open'] = '<li class="nextpage">';
$config['next_tag_close'] = '</li>';
$config['prev_tag_open'] = '<li class="nextpage">';
$config['prev_tag_close'] = '</li>';
$config['cur_tag_open'] = '<li class="currentpage">';
$config['cur_tag_close'] = '</li>';
$config['num_tag_open'] = '<li>';
$config['num_tag_close'] = '</li>';

Whilst in my controller, (as I want to be able to vary these settings) setting up the links is called with the following:

Code:
$this->load->library('pagination');
        
$this->config->load('pagination', 'TRUE');
        
$pagination['base_url'] = base_url().'browse/';
        
$pagination['total_rows'] = $this->db->count_all('items');
$pagination['per_page'] = 24;
        
$this->pagination->initialize($pagination);

I've never had a problem with this method of initialising the library locally, everything works as expected. But when it is uploaded to my server all I seem to get is the default html for the pagination class. Is it possible to do this and is codeigniter supposed to be working in this way locally?




Theme © iAndrew 2016 - Forum software by © MyBB