Return to Snippet

Revision: 70158
at December 4, 2015 01:47 by guimarca


Updated Code
public function getLab() { return $this->hasOne(Lab::className(), ['id' => 'id_lab'] );}
'lab.name_lab',

Revision: 70157
at December 3, 2015 23:20 by guimarca


Initial Code
public function getLab() { return $this->hasOne(Lab::className(), ['id_lab' => 'id_lab'] );}
'lab.name_lab',

Initial URL

                                

Initial Description
The 1stline in the function that generates the Foreign key relation in the model, 2nd is the name of the attribute in the gridview

Initial Title
Yii2 Gridview Foreign Key

Initial Tags
php

Initial Language
PHP