title: CakePHP associations with 3 tables
body: <p>I have 3 tables: Users, Profiles and Posts.</p>
  
  <p>A User may have one Profile, and a Profile must have a User, a Post must have a User, and User may have many Posts. I have set this up in my Models and it all seems to work fine.</p>
  
  <p>However when viewing a list of posts I am trying to show the Author firstname which is stored in the Profile table. But it's the User and Post table that are linked, and then the User table is linked to the Profile table. So their is no direct relation between the Post and the Profile.</p>
  
  <p>How do I get this information?</p>
  
  <p>Currently I'm trying to show this in the view with: <code>&lt;?php echo $post['Profile']['firstname']; ?&gt;</code> but because their is no direct association between the post and profile it does not work and I get the error: <code>Undefined index: Profile</code></p>
  
  <p>I have tried to do:</p>
  
  <pre><code>public function index()
      {
          $this-&gt;Post-&gt;recursive = 2;
          $this-&gt;set('posts', $this-&gt;paginate('Post'));
      }
  </code></pre>
  
  <p>but still no luck on getting the rest of the associations to come through!</p>
  
  <p>Can anyone help? Thanks</p>