view.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\DetailView;
  4. use app\models\Files;
  5. use yii\widgets\Breadcrumbs;
  6. /* @var $this yii\web\View */
  7. /* @var $model app\models\Files */
  8. echo Breadcrumbs::widget([
  9. 'itemTemplate' => "<li><i>{link}</i></li>\n", // template for all links
  10. 'links' => [
  11. [
  12. 'label' => 'Файли',
  13. 'url' => ['files/', 'id' => $model->id],
  14. 'template' => "<li><b>{link}</b></li>\n", // template for this link only
  15. ],
  16. ['label' => $model->id,]
  17. ],
  18. ]);
  19. //$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Files'), 'url' => ['index']];
  20. //$this->params['breadcrumbs'][] = $this->title;
  21. //$this->title = $model->user->username. ' | '. $model->user->email;
  22. ?>
  23. <div class="files-view">
  24. <?= DetailView::widget([
  25. 'model' => $model,
  26. 'attributes' => [
  27. 'id',
  28. 'path',
  29. 'name',
  30. [
  31. 'attribute' => 'user_id',
  32. 'value'=> function(Files $e)
  33. {
  34. return $e->user->username .' | '. $e->user->email;
  35. }
  36. ],
  37. //'user_id',
  38. 'auction_id',
  39. 'lot_id',
  40. 'date'
  41. ],
  42. ]) ?>
  43. <div></div>
  44. <p>
  45. <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [
  46. 'class' => 'btn btn-danger',
  47. 'data' => [
  48. 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
  49. 'method' => 'post',
  50. ],
  51. ]) ?>
  52. <?= Html::a(Yii::t('app', 'Download'), ['download', 'id' => $model->id], [
  53. 'class' => 'btn btn-success',
  54. 'data' => [
  55. 'confirm' => Yii::t('app', 'Are you sure you want to download this item?'),
  56. 'method' => 'post',
  57. ],
  58. ]) ?>
  59. </p>
  60. </div>