Blame view

backend/views/parser/server-files.php 1.65 KB
9075f464   Mihail   add action and vi...
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
  <?php
  use yii\helpers\Html;
  use yii\grid\GridView;
  use yii\grid\SerialColumn;
  use yii\grid\ActionColumn;
  use yii\widgets\Pjax;
  
  
  /* @var $this yii\web\View */
  /* @var $searchModel backend\models\CatalogSearch */
  /* @var $dataProvider yii\data\ActiveDataProvider */
  
  $this->title = 'Проверка прайсов';
  $this->params['breadcrumbs'][] = $this->title;
  Pjax::begin();
  
  ?>
      <div class="catalog-index">
  
          <h1><?= Html::encode($this->title) ?></h1>
  
          <?= GridView::widget( ['dataProvider' => $dataProvider,
              'columns' => [['class' => SerialColumn::className()],
                  [
                      'label' =>'Поставщик',
                      'value' => function ($data) {
                          return $data->importer;
                      },
                  ],
                  ['label' =>'Дата загрузки',
                      'attribute' => 'upload_time' ],
  
                  ['class' => ActionColumn::className(),
                  'template'=>'{delete}',
                      'buttons' => [
                          'delete' => function ($url, $model, $key) {
                              return Html::a('<span class="glyphicon glyphicon-remove"></span>', $url, [
                                  'title' => Yii::t('yii', 'Удалить файл'),
                                  'data-confirm' => 'Вы уверены что хотите удалить этот файл?',
                                  'data-method' => 'post',
                                  'data-pjax' => '1',
                              ]);
                          },
                      ],
                  ]
  
              ]] );?>
  
  
  
      </div>
  <?php
  Pjax::end();
  ?>