in my function: function show() { $this->set('products', $this->Session->read('Product')); }
i take the current session data and assign it to products. in the show view, this is the code: <table> <?php foreach ($products as $product): ?> <tr> <td><?php echo $product['id']; ?></td> <td><?php echo $product['name']; ?></td> <td><?php echo $product['description']; ?></td> <td><?php echo $product['price']; ?></td> <td><?php echo $product['virtual']; ?></td> <td><?php echo $product['active']; ?></td> <td><?php echo $product['sort_order']; ?></td> <td><?php echo $product['created']; ?></td> <td><?php echo $product['modified']; ?></td> </tr> <?php endforeach; ?> </table> which i figure should loop through the variable i set. but i'm getting a wierd result. this is the source being generated: <table> <tr> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td>7</td> <td>7</td> <td>7</td> <td>7</td> <td>7</td> <td>7</td> <td>7</td> <td>7</td> <td>7</td> </tr> <tr> <td>U</td> <td>U</td> <td>U</td> <td>U</td> <td>U</td> <td>U</td> <td>U</td> <td>U</td> <td>U</td> </tr> <tr> <td>B</td> <td>B</td> <td>B</td> <td>B</td> <td>B</td> <td>B</td> <td>B</td> <td>B</td> <td>B</td> </tr> <tr> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td>2</td> <td>2</td> <td>2</td> <td>2</td> <td>2</td> <td>2</td> <td>2</td> <td>2</td> <td>2</td> </tr> <tr> <td>2</td> <td>2</td> <td>2</td> <td>2</td> <td>2</td> <td>2</td> <td>2</td> <td>2</td> <td>2</td> </tr> <tr> <td>N</td> <td>N</td> <td>N</td> <td>N</td> <td>N</td> <td>N</td> <td>N</td> <td>N</td> <td>N</td> </tr> </table> when doing a <?php print_r($products); ?> in the view, it generates Array ( [id] => 1 [category_id] => 7 [name] => Uphill Battle [description] => Blah Blah Blah [price] => 1.00 [virtual] => 1 [active] => 1 [sort_order] => 1 [created] => 2007-06-24 13:59:27 [modified] => 2007-06-24 13:59:27 [image] => NONE ). so, how is this view generating such an odd result? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---