[eluser]jasont[/eluser]
Pagination seems to be working however after clicking page 2, you see page 2 and the pagination links show the same page with no link back to page 1.
Any ideas?
(I'm using uri segment 4 due to using folders)
here's the code used
Code:
// blog - Controller
function index()
{
$data['title'] = "My Real Title";
$data['heading'] = "My Real Heading";
$data['year'] = date('Y');
$this->load->model('blog/Blogmodel');
// Build Pagination
$this->load->library('pagination');
$config['base_url'] = base_url().'index.php/blog/blog/index/';
$config['total_rows'] = $this->db->count_all('posts');
$config['per_page'] = '2';
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$this->pagination->initialize($config);
$data['paging_links'] = $this->pagination->create_links();
// Get DB Data
$data['query'] = $this->Blogmodel->get_last_ten_entries($config['per_page'],$this->uri->segment(4));
// Output
$this->load->view('blog/blog_header', $data);
$this->load->view('blog/blogview', $data);
$this->load->view('blog/blog_footer', $data);
}
Code:
// blogview - View
<h1><?php echo $heading;?></h1>
<h3>Posts</h3>
<ul>
<?php foreach($query as $item):?>
<li><?php echo $item->title;?></li>
<?php endforeach;?>
</ul>
<?php echo $paging_links; ?>
Can't figure this one out. =/