// Controller
function index()
{
// Post->findAll will pull associated Comments too
$this->set('posts', $this->Post->findAll());
}
// Model - looks OK above. Your Comments foreign key should probably be
'post_id' though.
// Do you have a belongsTo set in your Comments model?
// View - will interate through each Comment in each Post.
<?php foreach($posts['Post'] as post): ?>
<!-- echo $post info here -->
<?php foreach($post['Comment]' as comment): ?>
<!-- echo $comment info here -->
<?php endforeach ?>
<?php endforeach ?>
-Brian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---