title: How to show the data from foreign key in case of different column name in CDetailView Yii
body: <p>How to show the data from foreign key <strong>in case of different column name</strong> in <strong>CDetailView</strong> Yii</p>
  
  <p>Table1</p>
  
  <pre><code>x1      x2
  1       sample text 1
  2       sample text 2
  3       sample text 3
  </code></pre>
  
  <p>Table2</p>
  
  <pre><code>y1      y2          y3 (foreign key x1)
  1       text 1      1
  2       text 2      1
  3       text 3      2
  </code></pre>
  
  <p><strong>I want to show the following result</strong></p>
  
  <pre><code>y1      y2          y3
  1       text 1      sample text 1
  2       text 2      sample text 1
  3       text 3      sample text 2
  </code></pre>
  
  <p>This is relation Code in Model Class</p>
  
  <pre><code>public function relations(){
      return array(
           'Table2' =&gt; array(self::BELONGS_TO, 'Table1', array('x1'=&gt;'y3'))
      );
  }
  </code></pre>
  
  <p>This is my CDetailView Code</p>
  
  <pre><code>&lt;?php $this-&gt;widget('zii.widgets.CDetailView', array(
      'data'=&gt;$model,
      'attributes'=&gt;array(
           array(
               'name'=&gt;'Table2.y3',
               'value'=&gt;$model-&gt;Table2-&gt;x2,
           ),
           'y1',
           'y2'
      ),
  )); ?&gt;
  </code></pre>
  
  <p><strong>I am getting the following Error</strong></p>
  
  <pre><code>Property "Table2.x1" is not defined. 
  </code></pre>