04-16-2012, 10:59 AM
[eluser]FrankStar[/eluser]
I'm using template views with embedded content views inside. So far so good; everything works pefectly. Now when a user logs in, I store the useful data in my session so it can be shared through the entire site. Then instead of calling the session data directly from the template view, I pass it through the controller like this:
However, as you can imagine this can become quite repetitive since I have to call this for every single pages.
How would you approach this situation? I don't have lot of experience using CI and designing login systems so any input would be greatly appreciated!
I'm using template views with embedded content views inside. So far so good; everything works pefectly. Now when a user logs in, I store the useful data in my session so it can be shared through the entire site. Then instead of calling the session data directly from the template view, I pass it through the controller like this:
Code:
$data['main_content'] = 'pages/profile'; // The subview with the content
$data['userdata'] = $this->session->userdata; // The logged in user info
$this->load->view('mytemplate', $data);
However, as you can imagine this can become quite repetitive since I have to call this for every single pages.
How would you approach this situation? I don't have lot of experience using CI and designing login systems so any input would be greatly appreciated!