Welcome Guest, Not a member yet? Register   Sign In
Pagination / Reduce footprint / Advice
#4

Thank you for your replies.

I use a config file for the 'core' pagination setup. I have tried to leave everything in there which I feel could be globally set, but still have a few to specify on a per controller basis. As sv3tli0 mentioned, this is maybe the nature of the beast.

Please see my config file below.

PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$config['uri_segment'] = 3;
$config['per_page'] = '10';
$config['page_query_string'] = FALSE;
$config['use_page_numbers'] = FALSE;
$config['query_string_segment'] = '';
$config['full_tag_open'] = '<nav><ul class="pagination">';
$config['full_tag_close'] = '</ul></nav>';
$config['first_link'] = '&laquo; First';
$config['first_tag_open'] = '<li class="prev page">';
$config['first_tag_close'] = '</li>';
$config['last_link'] = 'Last &raquo;';
$config['last_tag_open'] = '<li class="next page">';
$config['last_tag_close'] = '</li>';
$config['next_link'] = 'Next &rarr;';
$config['next_tag_open'] = '<li class="next page">';
$config['next_tag_close'] = '</li>';
$config['prev_link'] = '&larr; Previous';
$config['prev_tag_open'] = '<li class="prev page">';
$config['prev_tag_close'] = '</li>';
$config['cur_tag_open'] = '<li class="active"><a href="">';
$config['cur_tag_close'] = '</a></li>';
$config['num_tag_open'] = '<li class="page">';
$config['num_tag_close'] = '</li>';
$config['anchor_class'] = 'follow_link'

sv3tli0, I have moved the array elements onto one line. It's maybe a little ugly, but it will do for now.  Undecided

PHP Code:
$config['base_url'] = '/staff/index'$config['per_page'] = '1'$config["total_rows"] = $this->staff_model->count(); $config["num_links"] = round($config["total_rows"] / $config["per_page"]);
$this->pagination->initialize($config); 

I may just have to suck it up on this one. I was hoping there was going to be a cleaner way around this. sv3tli0, out of curiosity - which paging do you use?

Thanks for your time.

MoFish
Reply


Messages In This Thread
RE: Pagination / Reduce footprint / Advice - by MoFish - 12-07-2014, 02:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB