Welcome Guest, Not a member yet? Register   Sign In
Data that my 'views' can access which were set in MY_controller, possible?
#2

[eluser]Dennis Rasmussen[/eluser]
You can create a variable named data in your MY_controller.

Code:
$this->data = array();
$this->data['some_variable'] = $this->some_model->get_some_variable();
$this->data['page_title'] = 'Welcome!';
// ...

Then in your new controller:

Code:
$this->data['foo'] = 'bar';
$this->load->view('someview', $this->data);

That's probably the easiest way to do it.


Messages In This Thread
Data that my 'views' can access which were set in MY_controller, possible? - by El Forum - 09-29-2010, 02:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB