Welcome Guest, Not a member yet? Register   Sign In
Passing data to views called from another view
#8

[eluser]bleu[/eluser]
[quote author="CroNiX" date="1331057876"]
Code:
$this->load_vars($data);
Will make it globally available to all views. If you do that, you don't need to pass $data to the view.

Instead of:
Code:
$this->load->view('file', $data);
You would
Code:
$this->load_vars($data);
$this->load->view('file');  //variables in $data will be available to any view file
[/quote]


Thanks but how will I get my menu each time the user goes to a page

e.g My menu will display more menu items( which it will get from the database) as per the page selected.


I need to put my query and controller to get my menu in one place, but run it each time my user views a page and try to fetch that pages related menu


Messages In This Thread
Passing data to views called from another view - by El Forum - 03-06-2012, 07:28 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 07:41 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 07:56 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 08:10 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 11:06 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 11:17 AM
Passing data to views called from another view - by El Forum - 03-06-2012, 01:16 PM
Passing data to views called from another view - by El Forum - 03-07-2012, 05:01 AM
Passing data to views called from another view - by El Forum - 03-07-2012, 05:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB