[eluser]Nakul Khandelwal[/eluser]
This works:
Code:
$data['one'] = 1;
$data2['two'] = 2;
$this->load->view('mainView', $data);
$this->load->view('secondView', $data2);
But this does not:
Code:
$data['one'] = 1;
$data2['two'] = 2;
$this->load->view('mainView', $data, $data2);
Right now I am using <a href="http://php.net/manual/en/function.array-merge.php">array_merge</a> for the data array. But this includes a lot of unnecessary code in the controller as well as in the view when I have two big arrays to pass.
Is there a way to pass two arrays to a single view?