Posted By

guimarca on 12/03/15


php YII2

Versions (?)

Yii2 Gridview Foreign Key

 / 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

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

Report this snippet  

You need to login to post a comment.