Welcome Guest, Not a member yet? Register   Sign In
Where do you put header.php and footer.php?
#5

[eluser]johnnyForums[/eluser]
[quote author="jshultz" date="1249618997"]right. In the controller it's just 'page' and it equals the about view. so when the container view loads it knows that 'page' in this particular instance will be the about view. make sense?[/quote]

Yes, but I think that I am not understanding something fundemental.

How did $data['page'] in:


Code:
$data['page'] = 'about'; // pass the actual view to use as a parameter
     $this->load->view('container',$data);



become just $page in:

Code:
$this->load->view($page, $data);

I know you are passing $data to the view container and container.php gets $data. I'm just asking how come you can reference it as $page without the $data['page'] array prefix? What happened to $data['']?

Also, is $data the same for all these pages:

Code:
$this->load->view('header', $data);
          $this->load->view('menu');
          $this->load->view('sidebar', $data);
          $this->load->view($page, $data);
          $this->load->view('footer');

Seems like it is or that it must be.


Messages In This Thread
Where do you put header.php and footer.php? - by El Forum - 08-06-2009, 01:55 PM
Where do you put header.php and footer.php? - by El Forum - 08-06-2009, 02:14 PM
Where do you put header.php and footer.php? - by El Forum - 08-06-2009, 03:20 PM
Where do you put header.php and footer.php? - by El Forum - 08-06-2009, 05:23 PM
Where do you put header.php and footer.php? - by El Forum - 08-07-2009, 10:19 AM
Where do you put header.php and footer.php? - by El Forum - 08-07-2009, 10:34 AM
Where do you put header.php and footer.php? - by El Forum - 08-07-2009, 11:47 AM
Where do you put header.php and footer.php? - by El Forum - 08-07-2009, 02:11 PM
Where do you put header.php and footer.php? - by El Forum - 08-07-2009, 02:36 PM
Where do you put header.php and footer.php? - by El Forum - 08-08-2009, 08:58 AM
Where do you put header.php and footer.php? - by El Forum - 08-09-2009, 09:58 AM
Where do you put header.php and footer.php? - by El Forum - 08-09-2009, 10:09 AM
Where do you put header.php and footer.php? - by El Forum - 08-09-2009, 12:07 PM
Where do you put header.php and footer.php? - by El Forum - 08-09-2009, 12:15 PM
Where do you put header.php and footer.php? - by El Forum - 09-24-2009, 08:47 PM
Where do you put header.php and footer.php? - by El Forum - 09-25-2009, 03:56 AM
Where do you put header.php and footer.php? - by El Forum - 09-25-2009, 06:21 AM
Where do you put header.php and footer.php? - by El Forum - 09-25-2009, 03:36 PM
Where do you put header.php and footer.php? - by El Forum - 09-26-2009, 02:21 PM
Where do you put header.php and footer.php? - by El Forum - 09-28-2009, 02:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB