i got this erorr :
A PHP Error was encountered
Severity: Notice
Message: Undefined property: NewsController::$validation
Filename: controllers/NewsController.php
Line Number: 169
Fatal error: Call to a member function _set_fields() on a non-object in C:\AppServ\www\News\application\controllers\NewsController.php on line 169
..
class NewsController extends CI_Controller{
// num of records per page
private $limit = 10;
function News(){
parent::Controller();
// load library
$this->load->library(array('table','validation'));
// load helper
$this->load->helper('url');
// load model
$this->load->model('NewsModel','',TRUE);
}
function _set_fields(){
$fields['id'] = 'id';
$fields['title'] = 'title';
$fields['image'] = 'image';
$fields['discreption'] = 'discreption';
$this->validation->_set_fields($fields);
}
// validation rules
function _set_rules(){
$rules['title'] = 'trim|required';
$rules['image'] = 'trim|required';
$rules['discreption'] = 'trim|required';
$this->validation->set_rules($rules);
$this->validation->set_message('required', '* required');
$this->validation->set_message('isset', '* required');
$this->validation->set_error_delimiters('<p class="error">', '</p>');
}
}