title: CakePHP 3.0 get values on index.ctp instead id
body: <p>I have two tables, 'applications' and 'statuses' where there is a relation 'applications' BelongsTo 'statuses'.
  Lets begin with Model.</p>
  
  <p>This is what <strong>ApplicationsTable</strong> looks like:</p>
  
  <pre><code>public function initialize(array $config)
  {
      $this-&gt;table('applications');
      $this-&gt;displayField('title');
      $this-&gt;primaryKey('id');
      $this-&gt;addBehavior('Timestamp');
      $this-&gt;belongsTo('Users', [
          'foreignKey' =&gt; 'user_id',
          'joinType' =&gt; 'INNER'
      ]);
  
      $this-&gt;hasOne('Statuses', 
          'foreignKey' =&gt; 'status_id',
          'joinType' =&gt; 'INNER'
      ]);
  
      $this-&gt;belongsToMany('Statuses', [
          'foreignKey' =&gt; 'application_id',
          'targetForeignKey' =&gt; 'status_id',
          'joinTable' =&gt; 'applications_statuses'
      ]);
  }
  </code></pre>
  
  <p>And <strong>StatusesTable</strong> looks like:</p>
  
  <pre><code>public function initialize(array $config)
  {
      $this-&gt;table('statuses');
      $this-&gt;displayField('title');
      $this-&gt;primaryKey('id');
      $this-&gt;addBehavior('Timestamp');
      $this-&gt;hasMany('Applications', [
          'className' =&gt; 'Applications',
          'foreignKey' =&gt; 'status_id'
      ]);
  }
  </code></pre>
  
  <p>This is what <strong>ApplicationsController</strong> for index looks like:</p>
  
  <pre><code> public function index()
  {
      $this-&gt;paginate = [
          'contain' =&gt; 'Users', 'Statuses'
      ];
      $this-&gt;set('applications', $this-&gt;paginate($this-&gt;Applications));
      $this-&gt;set('_serialize', ['applications', 'statuses']);
  }
  </code></pre>
  
  <p>I want to show the titles of the status instead the id's on index.ctp</p>
  
  <p>And here <strong>index.ctp from Applications</strong> look like:</p>
  
  <pre><code>&lt;?php foreach ($applications as $application): ?&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;?= $application-&gt;has('user') ? $this-&gt;Html-&gt;link($application-&gt;user-&gt;name, ['controller' =&gt; 'Users', 'action' =&gt; 'view', $application-&gt;user-&gt;id]) : '' ?&gt;
          &lt;/td&gt;
          &lt;td&gt;&lt;?= $this-&gt;Html-&gt;link($application-&gt;title, ['action' =&gt; 'view', $application-&gt;id]) ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?= h($application-&gt;companyname) ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?= h($application-&gt;city) ?&gt;, &lt;?= h($application-&gt;country) ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?= h($application-&gt;status_id) ?&gt;&lt;/td&gt; // **I want to get the titles of the status instead the id.**
          &lt;td&gt;&lt;?= h($application-&gt;modified) ?&gt;&lt;/td&gt;
          &lt;td class="actions"&gt;
              &lt;?= $this-&gt;Html-&gt;link(__('Edit'), ['action' =&gt; 'edit', $application-&gt;id]) ?&gt;
              &lt;?= $this-&gt;Form-&gt;postLink(__('Delete'), ['action' =&gt; 'delete', $application-&gt;id], ['confirm' =&gt; __('Are you sure you want to delete # {0}?', $application-&gt;id)]) ?&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p><strong>But I got always as the output the id</strong>. I tried several ways:</p>
  
  <pre><code>1. &lt;?= h($application-&gt;status_title) ?&gt; // It doesn't work but it works for user
  
  2. 'contain' =&gt; ['Users', 'Statuses'] // Change in ApplicationsController
  &lt;?= $application-&gt;has('status') ? $this-&gt;Html-&gt;link($application-&gt;status-&gt;title, ['controller' =&gt; 'Statuses', 'action' =&gt; 'view', $application-&gt;status-&gt;id]) : '' ?&gt;
  
  3. &lt;td&gt;&lt;?= h($application-&gt;status-&gt;title); ?&gt;&lt;/td&gt;
  </code></pre>