view.php 2.23 KB
<?php
    
    use yii\helpers\Html;
    use yii\widgets\DetailView;
    use yiister\gentelella\widgets\Panel;
    
    /* @var $this yii\web\View */
    /* @var $model artbox\catalog\models\Option */
    
    $this->title = $model->lang->value;
    $this->params[ 'breadcrumbs' ][] = [
        'label' => \Yii::t('app', 'Variant option exclusion groups'),
        'url'   => [
            '/variant-option-group-exclusion/index',
        ],
    ];
    $this->params[ 'breadcrumbs' ][] = [
        'label' => $model->group->lang->title,
        'url'   => [
            '/variant-option-group-exclusion/view',
            'id' => $model->groupId,
        ],
    ];
    $this->params[ 'breadcrumbs' ][] = [
        'label' => Yii::t('catalog', 'Options'),
        'url'   => [
            'index',
            'group_id' => $model->groupId,
        ],
    ];
    $this->params[ 'breadcrumbs' ][] = $this->title;
?>
<div class="option-view">
    
    <?php
        $xPanel = Panel::begin(
            [
                'header' => Html::encode($this->title),
            ]
        );
    ?>
    <p>
        <?= Html::a(
            Yii::t('catalog', 'Update'),
            [
                'update',
                'id' => $model->id,
            ],
            [ 'class' => 'btn btn-primary' ]
        ) ?>
        <?= Html::a(
            Yii::t('catalog', 'Delete'),
            [
                'delete',
                'id' => $model->id,
            ],
            [
                'class' => 'btn btn-danger',
                'data'  => [
                    'confirm' => Yii::t('catalog', 'Are you sure you want to delete this item?'),
                    'method'  => 'post',
                ],
            ]
        ) ?>
    </p>
    
    <?= DetailView::widget(
        [
            'model'      => $model,
            'attributes' => [
                'id',
                'lang.value',
                [
                    'attribute' => 'lang.alias.value',
                    'label'     => \Yii::t('catalog', 'Alias'),
                ],
                'sort',
                'status:boolean',
                'created_at:datetime',
                'updated_at:datetime',
            ],
        ]
    ) ?>
    
    <?php
        $xPanel::end();
    ?>

</div>