06-25-2012, 11:36 AM
[eluser]CroNiX[/eluser]
I'd leave it the way you originally had it (not explicitly passing $this->data to the view, but then using $this->data['var'] within the view to access the data). Your data already exists as a class property ($this->data), since that's how you assigned it. If you then pass it to the view as the 2nd parameter of load::view(), it will turn each one of those array pieces into a new variable via the extract() function, using basically twice the resources than if you didn't.
Either that, or don't assign it to a class property and just use
I'd leave it the way you originally had it (not explicitly passing $this->data to the view, but then using $this->data['var'] within the view to access the data). Your data already exists as a class property ($this->data), since that's how you assigned it. If you then pass it to the view as the 2nd parameter of load::view(), it will turn each one of those array pieces into a new variable via the extract() function, using basically twice the resources than if you didn't.
Either that, or don't assign it to a class property and just use
Code:
$data['header'] = $this->load->view('header', $data, TRUE);