php - Codeigniter view returned as a string with data -
i'm using codeigniter 3 , im trying pull in view variable, , pass data view inclusion. view not recognising data being passed , telling me variable doesn't exist.
this how i'm calling view:
$view = $this->load->view('notifications/' . $report_type, $data ,true);
and in view i'm trying loop through $data , display appropriate, so:
foreach($data $item){ // echo stuffs }
i know $data definately contains data i've var_dump'ed it.
can this?
you need pass associative array loader.
$view = $this->load->view('notifications/' . $report_type, array('data' =>$data) ,true);
now variable visible @ view.
Comments
Post a Comment