[eluser]clintonbeattie[/eluser]
Hi,
I've updated some of the code but it still doesn't work...
This is my base_url "http://localhost/blog/"
The view should now use $pagination_links but same thing is happening.
This is teh url when I click on link "2" in the pagination, "http://localhost/blog/2" . 404 is shown.
Controller
Code:
function index()
{
$data['page_title'] = "Join Tables";
$data['description'] = "Blog";
$data['keywords'] = "Blog";
$config['base_url'] ='http://localhost/blog/';
$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();
//load the model and get results
$data['blogposts'] = $this->MBlog->getAllPosts($config['per_page'],$this->uri->segment(3));
$data['main'] = 'blog';
$this->load->vars($data);
$this->load->view('template');
}
View
Code:
<?php
foreach ($blogposts as $post){
echo "<h4>".$post['post_title']."</h4>";
echo "<p>".date('d M Y', strtotime($post['post_date'])) ."</p>";
echo "<p>".$post['post_intro']."</p>";
echo anchor('welcome/post/'.$post['id'],'Read More');
}
?>
<?php echo $paging_links; ?>