I am trying to pass an array and use it in my view from my controller but instead i am getting some errors...
In my Controller:
$data = array(
'a' => 'b',
'c' => 'd'
);
$this->load->view('home/index', $data);
In my View:
print_r($data);
throws errors and doesnt allow me to print it, since i am trying to then pass the array to another view for my app.
Error:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: data
Filename: home/index.php
Line Number: 1