title: Yii2 display multiple values from one relation in GridView
body: <p>I did my grid by the this instruction <a href="http://www.yiiframework.com/wiki/653/displaying-sorting-and-filtering-model-relations-on-a-gridview/" rel="nofollow">http://www.yiiframework.com/wiki/653/displaying-sorting-and-filtering-model-relations-on-a-gridview/</a>
  and it worked. But now I need to have two columns with data related to one column. For example in person/index the gridView must display cityName and cityRegion from the related record in the City table.</p>
  
  <p>I managed to display the data, but can't get the search functionality working.</p>
  
  <p>In the example from the link, at the end of the function search() there is</p>
  
  <pre><code>$query-&gt;andFilterWhere([
      //... other searched attributes here
  ])
  // Here we search the attributes of our relations using our previously configured
  // ones in "TourSearch"
  -&gt;andFilterWhere(['like', 'tbl_city.name', $this-&gt;city])
  -&gt;andFilterWhere(['like', 'tbl_country.name', $this-&gt;country]);
  </code></pre>
  
  <p>I think I should have something like: </p>
  
  <pre><code>-&gt;andFilterWhere(['like', 'tbl_city.name', $this-&gt;city])
  -&gt;andFilterWhere(['like', 'tbl_city.region', $this-&gt;city])
  </code></pre>
  
  <p>...but I don't know how to get the actual search values for (in this case name and region).</p>
  
  <p>Thanks!</p>
  
  <p>EDIT*
  Here is the whole search() and rules definition: <a href="http://pastebin.com/mUVDYNiH" rel="nofollow">http://pastebin.com/mUVDYNiH</a>
  Currently the sorting of prod_ProductCode and prod_Manufacturer is working, but the search boxes for them doesn't show up. </p>