title: Displaying Related Data in Gridview Using Yii2
body: <p>I have being struggling with related model data for a while and can't seem to pin point the problem, I have been reduced to using a very simple example.</p>
  
  <p>I have two models Dog and Owner, which have the following relations.</p>
  
  <p>Owner:</p>
  
  <pre><code>public function getDogs()
  {
      return $this-&gt;hasMany(Dog::className(), ['owner_id' =&gt; 'id']);
  }
  </code></pre>
  
  <p>Dog:</p>
  
  <pre><code>public function getOwner()
  {
      return $this-&gt;hasOne(Owner::className(), ['id' =&gt; 'owner_id']);
  }
  </code></pre>
  
  <p>As a simple test I want to get the dog to disaply from the grid view in the index page in Owner view
  This is my index.php in the Owner view</p>
  
  <pre><code>&lt;?= GridView::widget([
      'dataProvider' =&gt; $dataProvider,
      'filterModel' =&gt; $searchModel,
      'columns' =&gt; [
          ['class' =&gt; 'yii\grid\SerialColumn'],
  
          'id',
          'name',
          [       
              'attribute' =&gt; 'type',
              'value' =&gt; 'dog.type',
          ],
  
          ['class' =&gt; 'yii\grid\ActionColumn'],
      ],
  ]); ?&gt;
  </code></pre>
  
  <p>I must be missing something fundamental here?</p>