relations.php
1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
$this->title = Yii::t('relation', 'Relation for Group "{group}"', ['group' => $group->name]);
$this->params['breadcrumbs'][] = ['label' => Yii::t('rubrication', 'Tax Groups'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="group-relation">
<h1><?= Html::encode($this->title) ?></h1>
<!-- <p>-->
<!-- --><?//= Html::a(Yii::t('relation', 'Create relation'), ['create?relation='. $relation_key], ['class' => 'btn btn-success']) ?>
<!-- </p>-->
<?php
$dataProvider = new \yii\data\ArrayDataProvider([
'allModels' => $items,
'sort' => [
'attributes' => ['name', 'alias', 'entity1_label', 'entity2_label'],
],
'pagination' => [
'pageSize' => 10,
],
]);
?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'name',
'alias',
'entity1_label',
'entity2_label',
/*[
'class' => 'yii\grid\ActionColumn',
'template' => '{view}',
'buttons' => [
'view' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-th-list"></span>', $url, [
'title' => Yii::t('relation', 'View pars'),
]);
},
],
'urlCreator' => function ($action, $model, $key, $index) {
if ($action === 'view') {
$url ='/admin/relation/manage/pars?relation='. $model['key'];
return $url;
}
}
],*/
],
]); ?>
</div>