while running the codeigniter I have a following error:
A PHP Error was encountered Severity: Notice Message: Undefined property: Social::$social_model Filename: controllers/social.php Line Number: 10
Whats wrong with my code any help please?
controllers/social.php
class Social extends CI_Controller {
public function index(){
$data = array();
$this->load->view('header.php');
$this->load->view('staffs/content.php');
if ($query = $this-> social_model -> get_records()) // **[line 10]**
{
$data['records'] = $query;
}
$this->load->view('social/content.php', $data);
$this->load->view('footer.php');
}
// ....
}
models/social_model.php
<?php
class social_model extends CI_Model{
function get_records()
{
$query = $this->db->get('admins');
return $query -> result();
}
// ....
}