I am trying to store results in $data and pass it into the view
// controller
$data = DB::select('message')->from('comment')->as_assoc()->execute();
$this->response->body = View::factory('add-idea-form', $data);
// view
<?php foreach($comments as $r): ?>
<p><?=$r?></p>
<?php endforeach; ?>
I receive this error: http://cl.ly/B9ud (screenshot)
If I do this within the controller, while commenting out the load view line, it displays the data appropriately
foreach($data as $r):
print '<p>'.$r.'</p>';
endforeach;
I am coming from CI and I am use to passing an array of data to the view and looping thru it.
Any help is appreciated.