public function actionDeleteskill() { $skill_id = \Yii::$app->request->post('skill_id'); $model = Skills::findOne($skill_id); if ($model->delete()) { return $model; } else { return $model; } }
/** * @return \yii\db\ActiveQuery */ public function getSkill() { return $this->hasOne(Skills::className(), ['skill_id' => 'skill_id']); }
/** * @return \yii\db\ActiveQuery */ public function getSkills() { return $this->hasMany(Skills::className(), ['skill_id' => 'skill_id'])->viaTable('user_skills', ['user_id' => 'id']); }