view.php 1.64 KB
<?php
    
    use yii\helpers\Html;
    use yii\widgets\DetailView;
    use yiister\gentelella\widgets\Panel;
    
    /**
     * @var yii\web\View           $this
     * @var  \common\models\Slider $model
     */
    
    $this->title = $model->id;
    $this->params[ 'breadcrumbs' ][] = [
        'label' => \Yii::t('app', 'Slide'),
        'url'   => [ 'index' ],
    ];
    $this->params[ 'breadcrumbs' ][] = $this->title;
?>
<div class="slider-view">
    
    <?php
        $xPanel = Panel::begin(
            [
                'header' => $this->title,
            ]
        );
    ?>
  
  <p>
      <?= Html::a(
          \Yii::t('app', 'Update'),
          [
              'update',
              'id' => $model->id,
          ],
          [ 'class' => 'btn btn-primary' ]
      ) ?>
      <?= Html::a(
          \Yii::t('app', 'Delete'),
          [
              'delete',
              'id' => $model->id,
          ],
          [
              'class' => 'btn btn-danger',
              'data'  => [
                  'confirm' => \Yii::t('app', 'Are you sure you want to delete this item?'),
                  'method'  => 'post',
              ],
          ]
      ) ?>
  </p>
    
    <?= DetailView::widget(
        [
            'model'      => $model,
            'attributes' => [
                'id',
                'link',
                'status:boolean',
                'sort',
                [
                    'attribute' => 'image_id',
                    'value'     => $model->image->getUrl(),
                    'format'    => 'image',
                ],
            ],
        ]
    ) ?>
    
    <?php
        $xPanel::end();
    ?>
</div>