<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/**
 * @var yii\web\View $this
 * @var \core\entities\Settings $model
 */

$this->title = $model->section. '.' . $model->key;
$this->params['breadcrumbs'][] = ['label' => Yii::t('main', 'Settings'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="setting-view">

	<p>
		<?= Html::a(Yii::t('buttons','All Settings'), ['index'], ['class' => 'btn btn-default']) ?>
		<?= Html::a(Yii::t('buttons', 'Edit'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
		<?=
		Html::a(
			Yii::t('buttons', 'Delete'),
			['delete', 'id' => $model->id],
			[
				'class' => 'btn btn-danger',
				'data' => [
					'confirm' => Yii::t('buttons', 'Are you sure you want to delete this item?'),
					'method' => 'post',
				],
			]
		) ?>
	</p>

	<div class="box">
		<div class="box-body">
			<?=
			DetailView::widget(
				[
					'model' => $model,
					'attributes' => [
						'id',
						'type',
						'section',
						'active:boolean',
						'key',
						'value:ntext',
						[
							'attribute' => 'created_at',
							'format' => ['datetime', 'php:d.m.Y H:i'],
						],
						[
							'attribute' => 'updated_at',
							'format' => ['datetime', 'php:d.m.Y H:i'],
						],
					],
				]
			) ?>
		</div>
	</div>
</div>