I know this is a basic issue, but can't seem to get the correct
output.
function show() {
$this->set('products', array($this->Session-
>read('ShoppingCart.Product')));
}
generates the follow array currently:
Array
(
[0] => Array
(
[id] => 13
[category_id] => 7
[name] => Leaving Of Liverpool
[description] => Leaving Of Liverpool
[price] => 1.00
[virtual] => 1
[active] => 1
[sort_order] => 13
[created] => 2007-06-24 14:08:03
[modified] => 2007-06-24 14:08:03
[image] => NONE
)
[1] => Array
(
[id] => 16
[category_id] => 7
[name] => Yellow Submarine
[description] => Yellow Submarine
[price] => 1.00
[virtual] => 1
[active] => 1
[sort_order] => 16
[created] => 2007-06-24 14:10:02
[modified] => 2007-06-24 14:10:02
[image] => NONE
)
)
and this was my attempt in the view:
<table>
<?php
foreach($products as $key=>$value){
echo'<tr>';
foreach($value as $k => $v){
echo '<td>' . $value . '</td>';
}
echo '</tr>';
}
?>
</table>
but not getting the correct output. any ideas? i have a case of the
stupids when it comes to arrays.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---