There are 3 tables:
Profile (id) Skill-dictionary (id, skill) Profile_skill (id, id_profile, id_skill) Profile_skill is associated with two other tables by foreign keys fk_profile-skill_profile - id_profile -> id in the profile table fk_profile-skill_skill - id_skill -> id in Skill-dictionary
It is necessary to deduce the value of Skill-dictionary in the view profile (for the corresponding id in the profile ).
In the Profile.php model:
public function getProfileSkills() { return $this->hasMany(ProfileSkill::className(), ['id_profile' => 'id']) ->joinWith(['id ProfileSkill']) ->joinWith(['id SkillDictionary']); } In the Profile controller:
public function actionIndex() { $dataProvider = new ActiveDataProvider([ 'query' => Profile::find(), ]); return $this->render('index', [ 'dataProvider' => $dataProvider, ]); }