My $data array is not getting passed to the view per the code and errors shown below.
public function myAccount(){
$data = array(
'templateVersion' => 'template1',
'headerVersion' => 'header2',
'css' => '',
'navBarVersion' => 'navBar2',
'main_content' => 'myaccount/myAccount',
'page_title' => 'example.com - My Account',
'footerVersion' => 'footer2'
);
if (($this->session->userdata('is_logged_in')) == 1) {
$config['upload_path'] = $this->logo_path;
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['encrypt_name'] = TRUE;
$this->load->library('upload', $config);
if ($this->input->post('upload')) {
if(!$this->upload->do_upload('userfile')){
echo $this->upload->display_errors('<p>', '</p>');
} else {
$w = $this->upload->data();
$data = array(
'field_input_name' => $w['file_name'],
);
//$this->db->insert('table_image', $data);
echo "here";
//exit;
}
}
//******************************************
// For some reason, $data is not passed in!
// Have posted the web screen error far below.
$this->load->view('includes/template1', $data);
}else{
redirect('site/restricted');
}
}
////////////////////////////////////////////////////////////////////
A PHP Error was encountered Severity: Notice Message: Undefined variable: headerVersion Filename: includes/template1.php Line Number: 4
An Error Was Encountered
Unable to load the requested file: includes/.php