ubn5/backend/modules/forum/views/comment/view.php

59 lines
2.1 KiB
PHP

<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\ForumComment */
$this->title = $model->forum_comment;
$this->params['breadcrumbs'][] = ['label' => 'คอมเม้น', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->forum_comment, 'url' => ['view', 'id' => $model->id]];
\yii\web\YiiAsset::register($this);
?>
<div class="card">
<div class="card-header">
<h4 class="card-title"><?= $model->forum_comment?></h4>
<a class="heading-elements-toggle"><i class="fa fa-ellipsis-v font-medium-3"></i></a>
<div class="heading-elements">
<ul class="list-inline mb-0">
<?= Html::a('แก้ไข', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('ลบ', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
<li><a data-action="expand"><i class="ft-maximize"></i></a></li>
</ul>
</div>
</div>
<div class="card-body">
<?= DetailView::widget([
'model' => $model,
'attributes' => [
//'id',
[
'attribute' => 'forum_thread_id',
'value' => function ($model) {
return $model->forumThread->name;
}
],
'forum_comment',
'comment_by',
/* [
'attribute' => 'status',
'value' => function ($model) {
$arr = [0 => 'ไม่ใช้งาน', 1 => 'ใช้งาน'];
return $arr[$model->status];
}
],*/
'created_at:datetime',
'updated_at:datetime',
],
]) ?>
</div>
</div>