phpist

Untitled

Dec 3rd, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <?php
  2.  
  3. use yii\helpers\Html;
  4. use yii\widgets\DetailView;
  5.  
  6. /* @var $this yii\web\View */
  7. /* @var $model app\modules\admin\models\Product */
  8.  
  9. $this->title = $model->name;
  10. $this->params['breadcrumbs'][] = ['label' => 'Products', 'url' => ['index']];
  11. $this->params['breadcrumbs'][] = $this->title;
  12. ?>
  13. <div class="product-view">
  14.  
  15. <h1><?= Html::encode($this->title) ?></h1>
  16.  
  17. <p>
  18. <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
  19. <?= Html::a('Delete', ['delete', 'id' => $model->id], [
  20. 'class' => 'btn btn-danger',
  21. 'data' => [
  22. 'confirm' => 'Are you sure you want to delete this item?',
  23. 'method' => 'post',
  24. ],
  25. ]) ?>
  26. </p>
  27. <?php $img = $model->getImage(); ?>
  28. <? debug($model->image); ?>
  29. <?= DetailView::widget([
  30. 'model' => $model,
  31. 'attributes' => [
  32. 'id',
  33. 'category_id',
  34. 'name',
  35. 'content:html',
  36. 'price',
  37. 'keywords',
  38. 'description',
  39. [
  40. 'attribute' => 'image',
  41. 'value' => function($model){
  42. return Html::img('@web/upload/store/Products/Product1/' . $model->image);
  43. },
  44. 'format' => 'html'
  45. ],
  46. 'hit',
  47. 'new',
  48. 'sale',
  49. ],
  50. ]) ?>
  51.  
  52. </div>
Advertisement
Add Comment
Please, Sign In to add comment