[eluser]mikeymayhem[/eluser]
Hi,
just a quick question, I've moved my pagination config array into a file called pagination.php and saved it in the config/ folder as described in the user gallery. As I have pagination throughout my website I was trying to figure out how to make this re_usable.
Code:
/*
|-----------------------------------------------------------------------------|
| 1 base_url |
|-----------------------------------------------------------------------------|
*/
$config['base_url'] = $base_url;
//IE http://www.example.com/news/
/*
|-----------------------------------------------------------------------------|
| 2 Total num of items |
|-----------------------------------------------------------------------------|
*/
$config['total_rows'] = $total;
//the total number of items being paginated
/*
|-----------------------------------------------------------------------------|
| 3 per page |
|-----------------------------------------------------------------------------|
*/
$config['per_page'] = $per_page;
//total number items to be displayed per page
/*
|-----------------------------------------------------------------------------|
| 4 uri segment |
|-----------------------------------------------------------------------------|
*/
$config['uri_segment'] = $segment;
//the segemnt of the url to be used in pull items
//from the database ie www.eample.com/seg1/seg2/seg3/seg4
The above code is from my pagination config file, basically I have four variables I need to make this config file re-usable throughout my site, $base_url,$per_page,$total and $segment. How can I achieve this if it is at all possible!
Any help or suggestions would be greatly appreciated!