Blame view

app/modules/admin/views/mod/index.php 1.92 KB
bf807468   Alex Savenko   first commit
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
  <?
  use yii\helpers\Html;
  use yii\grid\GridView;
  
  $this->title = 'Модификации';
  $this->params['breadcrumbs'][] = $this->title;
  ?>
  <h1>Модификации</h1>
  <?= Html::a('Вернуться к продуктат', ['/admin/products/index','catID'=>$_GET['catID']], ['class'=>'btn btn-info']) ?>
  
  <?= Html::a('Создать', ['/admin/mod/save','productID'=>$_GET['productID'],'catID'=>$_GET['catID']], ['class'=>'btn btn-success']) ?>
  <?= GridView::widget([
      'dataProvider' => $dataProvider,
      'columns' => [
  		[
  		'attribute' => 'id',
  		'value'=>'id',
  		'contentOptions'=>['style'=>'width: 70px;']
  		],
  		[
  		'attribute' => 'name',
  		'value'=>'name',
  		//'contentOptions'=>['style'=>'max-width: 300px;']
  		],
  		[
  		'attribute' => 'cost',
  		'value'=>'cost',
  		'contentOptions'=>['style'=>'width: 170px;']
  		],        
          [
              'class'    => 'yii\grid\ActionColumn',
              'template' => '{update}&nbsp;&nbsp;{delete}',
  			        'buttons' => [
                          'update' => function ($url, $model) {
                          return Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['/admin/mod/save','id'=>$model->id,'productID'=>$_GET['productID'],'catID'=>$_GET['catID']], 
                          [
                              'title' => "Редактировать",
                          ]);
                      },
                  'delete' => function ($url, $model) {
                          return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['/admin/mod/delete','id'=>$model->id,'productID'=>$_GET['productID'],'catID'=>$_GET['catID']], 
                          [
                              'title' => "Удалить",
                              'data-confirm' => 'Желаете удалить запись?',
                          ]);
                      },
                             
                  ],
  			'contentOptions'=>['style'=>'width: 70px;']
          ],		
      ],
  ]) ?>