Im trying to get the total unread accounts from the database, the value is assigned to $data['head']
I want to make the $data['head'] available globally so it will be automatically loaded into the template and displayed on the header.
What is the best way to do this?
Below is my controller
function __construct()
{
parent::__construct();
$this->load->model('process_model');
$data['headbody']='includes/header';
$data['head'] = $this->process_model->loadnew($this->session->userdata('id'));
}
function invform()
{
$this->load->model('slave');
$data['body']='slave-account';
$data['questions'] = $this->slave->loadq($this->uri->segment(3));
$this->load->view('includes/template',$data);
}
View
$this->load->view($head);
$this->load->view($body);
$this->load->view('includes/footer');