Hello, I have the following code where I log in and I save the data in Array
. I want to know what is the way to get data in a view.
function check_database($pwd){
$username = $this->input->post('username');
$result = $this->m->login($username, $pwd);
if ($result){
foreach($result as $row){
$sess_array = array(
'Codigo' => $row->Codigo,
'Nombre' => $row->Nombre,
);
$this->session->set_userdata('logged_in', $sess_array);
}
return TRUE;
} else {
$this->form_validation->set_message('check_database', 'Usuario Invalido');
return false;
}
}
Here I charge the view:
public function menu(){
if (!$this->session->userdata('logged_in')) {
redirect('main/index', 'refresh');
}
$this->load->view('dashboard');
}
View:
<?php include ('header.php'): ?>
//Aqui ver los datos de la persona logueada
<?php include ('footer.php'): ?>