[eluser]Rob Rightmyer[/eluser]
We are having problems using pagination in conjunction with URI routing.
Things are working as expected
except the "current" page is not advancing when each pagination link is clicked.
Routes.php:
Code:
$route['gallery2/:num'] = "gallery2/index";
Gallery2.php (controller):
Code:
<?php
class Gallery2 extends Controller {
function Gallery2()
{
parent::Controller();
//Load the HTML, URL and Form helpers
$this->load->helper('html');
$this->load->helper('url');
$this->load->helper('form');
}
function index()
{
//Load the Database class
$this->load->database();
//Load the pagination libarary, setup pagination variables, initialize pagination
$this->load->library('pagination');
$config['base_url'] = base_url().'gallery2';
$config['total_rows'] = $this->db->count_all('gallery');
$config['per_page'] = '8';
$config['num_links'] = '100';
$this->pagination->initialize($config);
//Sort the database results
$this->db->order_by('id', 'desc');
//Query the database
$data['query'] = $this->db->get('gallery', $config['per_page'],$this->uri->segment(2));
//Load the Photo Gallery view
$this->load->view('gallery2', $data);
}
}
?>
If I've ommitted any information that would be helpful in solving this please let me know.