https://stackoverflow.com/questions/45278944/how-to-display-filtering-model-relations-on-a-gridview
https://www.yiiframework.com/doc/guide/2.0/en/output-data-widgets
```
You can do this by simply accessing it like:
'columns'=>[
'country.columnName',
]);
In model override attributes() function:
public function attributes()
{
// add related fields to searchable attributes
return array_merge(parent::attributes(), ['country.columnName']);
}
Add it to rules:
public function rules()
{
return [
[['country.columnName'], 'safe'],
// ... more stuff here
];
}
And in search() method, add this to your Query:
$query->andFilterWhere(['LIKE', 'country.columnName', $this->getAttribute('country.columnName')]);
```