/ Published in: PHP
The 1stline in the function that generates the Foreign key relation in the model, 2nd is the name of the attribute in the gridview
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function getLab() { return $this->hasOne(Lab::className(), ['id' => 'id_lab'] );} 'lab.name_lab',