server-files.php 1.65 KB
<?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();
?>