public function getIdSotrud()
    {
        return $this->hasOne(User::className(), ['id' => 'id_sotrud']);
    }public function actionView($id)
    {
        $user->idSotrud->name;
        return $this->render('view', [
            'model' => $this->findModel($id),
            'user' => $user,
        ]);
    }DetailView::widget([
 [
                'attribute' => 'id_sotrud',
                'value' => $user,
            ],
])  public function actionView($id)
{
    $user->idSotrud->name; // что за переменная $user откуда она взялась? что Вы вообще хотите сделать в этой строке.
    return $this->render('view', [
        'model' => $this->findModel($id),
        'user' => $user,
    ]);
}DetailView::widget([
    [
        'attribute' => 'id_sotrud', // а тут что Вы ожидаете увидеть? 
                                  // данные реляции? так Вы ж их не выводите
        'value' => $user,
    ],
])      $user->idSotrud->name; сразу выдало бы ошибку.public function actionView($id)
    {
        $user->idSotrud->name; // тут же у Вас просто переменная из ниоткуда появилась
        return $this->render('view', [
            'model' => $this->findModel($id), //тут тоже
            'user' => $user,
        ]);
    }public function actionView($id)
    {
        $model = MyModel::find()->andWhere(['id'=>$id])->with('idSotrud')->one();
        $sotrud_name = $model->idSotrud->name;
        return $this->render('view', [
            'model' => $model,
            'sotrud_name' => $sotrud_name,
        ]);
    }