Welcome Guest, Not a member yet? Register   Sign In
Accessing session array from embedded view
#1

[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:

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!


Messages In This Thread
Accessing session array from embedded view - by El Forum - 04-16-2012, 10:59 AM
Accessing session array from embedded view - by El Forum - 04-16-2012, 11:03 AM
Accessing session array from embedded view - by El Forum - 04-16-2012, 11:39 AM
Accessing session array from embedded view - by El Forum - 04-16-2012, 12:23 PM
Accessing session array from embedded view - by El Forum - 04-16-2012, 12:49 PM
Accessing session array from embedded view - by El Forum - 04-16-2012, 12:54 PM
Accessing session array from embedded view - by El Forum - 04-16-2012, 12:55 PM
Accessing session array from embedded view - by El Forum - 04-16-2012, 01:05 PM
Accessing session array from embedded view - by El Forum - 04-16-2012, 01:08 PM
Accessing session array from embedded view - by El Forum - 04-16-2012, 01:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB