[eluser]slowgary[/eluser]
In your controller, you're assigning $data['obj'] = $o, so using a foreach() in your view is not necessary, since $obj is not an array. foreach() doesn't chop any of your data out, it just iterates through array elements, assigning their value to a temporary variable for you to display or make calculations on.
It looks like maybe you'd want to do something like this:
Code:
//controller
$o = new Order();
$o->get_iterated();
$o->product->get();
$data['order'] = $o;
//view
<td><?php echo $order->id; ?></td>
<td>
<ul>
<?php foreach($order->product as $product): ?>
<li><?php echo $product->name; ?></li>
<?php endforeach; ?>
</ul>
</td>
I wouldn't recommend creating new Product objects in your view, especially if these make database calls. The general idea with MVC is that your controllers do that work.
I hope this helps.