• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with session in template

#1
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:
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.
Reply


Messages In This Thread
problem with session in template - by StratoKyke - 05-14-2015, 02:35 AM
RE: problem with session in template - by CroNiX - 05-16-2015, 03:56 PM
RE: problem with session in template - by CroNiX - 05-17-2015, 09:52 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.