I am new to the codeigniter and trying the tutorials in the user guide. But i stuck i the third tutorial which is for the create news items. Here in my controller section it is giving the following error:
Severity: Notice
Message: Undefined property: News::$form_validation
Filename: controllers/news.php
Line Number: 44
and the code that i used in the controller section is
public function create()
{
$this->load->helper('form');
$this->load->library('form_validation');
$data['title'] = 'Create a news item';
$this->form_validation->set_rules('title', 'Title', 'required');
$this->form_validation->set_rules('text', 'text', 'required');
if ($this->form_validation->run() === FALSE)
{
$this->load->view('templates/header', $data);
$this->load->view('news/create');
$this->load->view('templates/footer');
}
else
{
$this->news_model->set_news();
$this->load->view('news/success');
}
}
Please help me.
Thanks in advance.