index.php 1.49 KB
<?php
    
    use yii\helpers\Html;
    use yii\grid\GridView;
    use yiister\gentelella\widgets\Panel;
    
    /* @var $this yii\web\View */
    /* @var $searchModel artbox\order\models\LabelSearch */
    /* @var $dataProvider yii\data\ActiveDataProvider */
    
    $this->title = Yii::t('order', 'Labels');
    $this->params[ 'breadcrumbs' ][] = $this->title;
?>
<div class="label-index">
    <?php
        $xPanel = Panel::begin(
            [
                'header' => $this->title,
            ]
        );
    ?>
  <p>
      <?= Html::a(Yii::t('order', 'Create Label'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
  </p>
    <?= GridView::widget(
        [
            'dataProvider' => $dataProvider,
            'filterModel'  => $searchModel,
            'columns'      => [
                [ 'class' => 'yii\grid\SerialColumn' ],
                
                'id',
                [
                    'label' => 'SSSS',
                    'attribute' => 'title',
                    'value'     => 'lang.title',
                ],
                'value',
                [
                    'attribute' => 'status',
                    'filter'    => [
                        0 => \Yii::$app->formatter->asBoolean(false),
                        1 => \Yii::$app->formatter->asBoolean(true),
                    ],
                ],
                
                [ 'class' => 'yii\grid\ActionColumn' ],
            ],
        ]
    ); ?>
    <?php
        $xPanel::end();
    ?>
</div>