[eluser]Mr. Pickle[/eluser]
Hi there, I've got a question on how to merge global and controller data to one array.
I now have a MY_Controller performing tasks for every request (such as session status, getting the main navigation items from the db etc.) This writes the data necassary for all requests to
Of course in my controller functions I also set the data specfic for the request.
There I set the data to:
Code:
$data = array(/*data array here*/);
Before sending the data to the view I want to have both arrays in one array (as you can only send one data array with your view) I do it like this:
Code:
$data = array_merge($data, $this->data)
Now I have in my views available both the global data and the controller function data.
Is this the way to do it in CI, or do I oversee some internal function/method to get this sorted better?