title = 'Менеджер: ' . ArrayHelper::getValue($model,'user.username'); $this->params['breadcrumbs'][] = ['label' => 'Managers', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; YiiAsset::register($this); ?>
= Html::a('Список', ['index', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> = Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> = Html::a('Удалить', ['delete', 'id' => $model->id], [ 'class' => 'btn btn-danger', 'data' => [ 'confirm' => 'Вы уверены, что хотите удалить менеджера?', 'method' => 'post', ], ]) ?>
= DetailView::widget([ 'model' => $model, 'attributes' => [ 'id', [ 'attribute' => 'user_id', 'value' => ArrayHelper::getValue($model,'user.username'), ], ], ]) ?> = GridView::widget([ 'dataProvider' => $managerEmployeeDataProvider, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], [ 'attribute' => 'user_id', 'filter' => User::find()->select(['username', 'id'])->indexBy('id')->column(), 'value' => 'user.username', ], [ 'class' => 'yii\grid\ActionColumn', 'template' => '{view} {update} {delete}', 'controller' => 'manager-employee', 'buttons' => [ 'update' => function ($url,$model) { return Html::a( '', ['manager-employee/update', 'id' => $model['id'], 'manager_id' => $model['manager_id']]); }, 'delete' => function ($url,$model) { return Html::a( '', [ 'manager-employee/delete', 'id' => $model['id'], 'manager_id' => $model['manager_id'] ], [ 'data' => ['confirm' => 'Вы уверены, что хотите удалить этого сотрудника?', 'method' => 'post'] ] ); }, ], ], ], ]); ?>