title: CakePHP: Retrieve specific table field in controller
body: <p>I am new to Cake and tried to find the best solution to retrieve a specific field belonging to an $id:</p>
  
  <p>This is my view function in my Post controller</p>
  
  <pre><code>function view($id = null) {
      if (!$id) {
          $this-&gt;Session-&gt;setFlash(__('Invalid post', true));
          $this-&gt;redirect(array('action' =&gt; 'index'));
      }
      $this-&gt;set('post', $this-&gt;Post-&gt;read(null, $id));
  }
  </code></pre>
  
  <p>In the post table, there is a user_id foreign key. I need to retrieve this specific field belonging to this Post $id.</p>
  
  <p>I read about functions as find('All), read() or just drop an unconventional session in the view through:</p>
  
  <pre><code>$session-&gt;write('example') = $post['Post']['user_id];
  </code></pre>
  
  <p>What is the best way to do this, my preference is to retrieve the field in the controller. Thanks!</p>