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

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -