title: How do I get data from associated models in CakePHP?
body: <p>I create a simple blog with cakephp where i have some posts and some comments.
  After i bake an application it create a <code>comments</code> folder with the <code>index.ctp</code> and a <code>posts</code> folder with <code>the index.ctp</code> </p>
  
  <p>What i want to do is display them as fallow:</p>
  
  <pre><code>Post1
    comment1
    comment2
  Post2
    comment1
    comment2
  </code></pre>
  
  <p>If i place the comments inside the posts/index.ctp i get an error telling me that the <code>$comments</code> is not defined.</p>
  
  <p>How can i do this?
  Thanks</p>
  
  <p>edit:
  alright, im sorry for the comeback, but it's still a bit unclear. I do have the <code>$hasMany</code> relationship setup, in fact on the page that displays the posts i have a link that points me to the comments. The only thing that i want them to be displayed in the same page as the posts.</p>
  
  <p>i should be able to say <code>&lt;?php echo $comment['Comment']['content']; ?&gt;</code></p>