Hi All,

How to make findAll() return object?

I write this in my controller:

<code>
function listof() {
   $this->set('posts', $this->Post->findAll());
}
</code>

then I want my "listof" view like this:

<table>
<tr><th>Title</th><th>Body</th></tr>
<?php foreach ($posts as $post): ?>
  <tr>
     <td><?php echo $post->title ?></td>
      <td><?php echo $post->body ?></td>
   </tr>
<?php endforeach; ?>
</table>

-- 
Regards,
Ananda Putra

--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to