2022-11-08 18:01:42 +03:00
|
|
|
<?php
|
|
|
|
|
2022-12-09 16:18:57 +03:00
|
|
|
use backend\modules\document\models\DocumentTemplate;
|
2022-11-10 16:00:43 +03:00
|
|
|
use common\helpers\StatusHelper;
|
2022-11-08 18:01:42 +03:00
|
|
|
use yii\helpers\Html;
|
|
|
|
use yii\widgets\DetailView;
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
|
|
|
/* @var $model backend\modules\document\models\DocumentTemplate */
|
|
|
|
|
|
|
|
$this->title = $model->title;
|
|
|
|
$this->params['breadcrumbs'][] = ['label' => 'Document Templates', 'url' => ['index']];
|
|
|
|
$this->params['breadcrumbs'][] = $this->title;
|
|
|
|
\yii\web\YiiAsset::register($this);
|
|
|
|
?>
|
|
|
|
<div class="document-template-view">
|
|
|
|
|
|
|
|
<p>
|
2022-11-10 16:00:43 +03:00
|
|
|
<?= Html::a('Список', ['index', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
|
|
|
<?= Html::a('Изменить', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
|
|
|
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
2022-11-08 18:01:42 +03:00
|
|
|
'class' => 'btn btn-danger',
|
|
|
|
'data' => [
|
|
|
|
'confirm' => 'Are you sure you want to delete this item?',
|
|
|
|
'method' => 'post',
|
|
|
|
],
|
|
|
|
]) ?>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<?= DetailView::widget([
|
|
|
|
'model' => $model,
|
|
|
|
'attributes' => [
|
|
|
|
'id',
|
|
|
|
'title',
|
2022-11-10 16:00:43 +03:00
|
|
|
[
|
|
|
|
'attribute' => 'status',
|
|
|
|
'format' => 'raw',
|
|
|
|
'value' => StatusHelper::statusLabel($model->status),
|
|
|
|
],
|
|
|
|
'created_at',
|
|
|
|
'updated_at',
|
|
|
|
[
|
|
|
|
'attribute' => 'template_body',
|
|
|
|
'format' => 'raw'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'attribute' => 'Переменные в шаблоне',
|
2022-12-09 16:18:57 +03:00
|
|
|
'value' => function(DocumentTemplate $model){
|
|
|
|
return implode(", ", $model->getFields());
|
2022-11-10 16:00:43 +03:00
|
|
|
},
|
|
|
|
],
|
2022-11-08 18:01:42 +03:00
|
|
|
],
|
|
|
|
]) ?>
|
|
|
|
|
|
|
|
</div>
|