<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use app\models\Files;
use yii\widgets\Breadcrumbs;

/* @var $this yii\web\View */
/* @var $model app\models\Files */

 echo Breadcrumbs::widget([
    'itemTemplate' => "<li><i>{link}</i></li>\n", // template for all links
    'links' => [
        [
            'label' => 'Файли',
            'url' => ['files/', 'id' => $model->id],
            'template' => "<li><b>{link}</b></li>\n", // template for this link only
        ],
        ['label' => $model->id,]

    ],
]);


//$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Files'), 'url' => ['index']];
//$this->params['breadcrumbs'][] = $this->title;
//$this->title = $model->user->username. ' | '. $model->user->email;
?>


<div class="files-view">



    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'path',
            'name',
            [
                'attribute' => 'user_id',
                'value'=> function(Files $e)
                {
                    return $e->user->username .' | '. $e->user->email;
                }
            ],
            //'user_id',
            'auction_id',
            'lot_id',
            'date'
        ],
    ]) ?>
    <div></div>

    <p>

        <?= 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',
            ],
        ]) ?>

        <?= Html::a(Yii::t('app', 'Download'), ['download', 'id' => $model->id], [
            'class' => 'btn btn-success',
            'data' => [
                'confirm' => Yii::t('app', 'Are you sure you want to download this item?'),
                'method' => 'post',
            ],
        ]) ?>
    </p>

</div>


