[eluser]maddy_ssn[/eluser]
hi 2 everyone i am creating a blog
this is my code . In this code iam trying to implement the pagination in my blog ,this is
controller part
<?php
class Blog extends Controller {
function Blog()
{
parent::controller();
$this->load->helper('url');
$this->load->helper('form');
$this->load->database();
}
function index()
{
$s['title'] = "Learning CodeIgniter";
$s['heading'] = "Learn The Basics of CodeIgniter";
$s['query'] = $this->db->get('entries');
$this->load->view('blogs_view',$s);
$this->load->library('pagination');
$config['base_url'] = base_url().'index.php/blog/comments/';
$config['total_rows'] = $this->db->count_all('entries');
$config['per_page'] = 04;
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$this->pagination->initialize($config);
$this->load->model('blog_model');
$data['results'] = $this->blog_model->get_blog($config['per_page'],$this->uri->segment(3));
$this->load->view('blogs_view',$data);
}
function comments()
{
$s['title'] = "Learning comments CodeIgniter";
$s['heading'] = "Leraning The Basics";
$this->db->where('entry_id',$this->uri->segment(3));
$s['query'] = $this->db->get('comments');
$this->load->view('comment_view',$s);
}
function comment_insert()
{
$this->db->insert('comments', $_POST);
redirect('blog/comments/'.$_POST['entry_id']);
}
}
?>
and this my model part
<?php
class blog_model extends Model {
function blog()
{
parent::Model();
}
function get_blog($num, $offset)
{
$query = $this->db->get('comments', $num, $offset);
return $query;
}
}
?>
problem is, when i run the code it will show the following error
An Error Was Encountered
Unable to locate the model you have specified: blog_model
but i saved my model file in model folder.so anyone help me to finish my blog