fitness-web/frontend/views/product/view.php

49 lines
1.3 KiB
PHP

<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Product */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/product', 'Products'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="product-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('frontend/product', 'Update'), ['update', 'id' => $model->id_product], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('frontend/product', 'Delete'), ['delete', 'id' => $model->id_product], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('frontend/product', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_product',
'id_product_category',
'id_account',
'product_number',
'barcode',
'purchase_price',
'sale_price',
'profit_margins',
'status',
'description',
'created_at',
'updated_at',
'stock',
'name',
],
]) ?>
</div>