Welcome Guest, Not a member yet? Register   Sign In
pass variable to template file
#1

[eluser]mazdaFan[/eluser]
Hi! I'm new in CI and need some help.

I have function that return site menu and the result of the function is passed to template file, but i don't want to have this in each function:

Code:
$this->load->model('Products');
$data['menu'] = $this->Products->showMenu();
//$data['body'] = 'bla bla';
$this->load->view('welcome_message', $data);


is there a way to globally set $data['menu']...

Sorry for bad english ;(


Messages In This Thread
pass variable to template file - by El Forum - 07-06-2009, 05:35 AM
pass variable to template file - by El Forum - 07-06-2009, 05:42 AM
pass variable to template file - by El Forum - 07-06-2009, 07:21 AM
pass variable to template file - by El Forum - 07-06-2009, 07:54 AM
pass variable to template file - by El Forum - 07-06-2009, 08:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB