05-14-2015, 02:35 AM
(This post was last modified: 05-14-2015, 04:53 AM by StratoKyke.)
I would have the need to use the if statement within the view to display different data depending if the user is logged in or not.
In this moment the controller is:
I use the smarty template.
How can I make sure to spend the session management across smarty template? So the management and data?
Thanks for the reply.
In this moment the controller is:
PHP Code:
public function index() {
if($this->session->userdata('logged_in')){
$session_data = $this->session->userdata('logged_in');
$data['username'] = $session_data['login'];
$this->smarty->view('home.tpl', $data);
} else {
redirect('user/login', 'refresh');
}
}
I use the smarty template.
How can I make sure to spend the session management across smarty template? So the management and data?
Thanks for the reply.