view.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\DetailView;
  4. /** @var yii\web\View $this */
  5. /** @var manager\models\Comments $model */
  6. $this->title = $model->id;
  7. $this->params['breadcrumbs'][] = ['label' => 'Comments', 'url' => ['index']];
  8. $this->params['breadcrumbs'][] = $this->title;
  9. \yii\web\YiiAsset::register($this);
  10. ?>
  11. <div class="comments-view">
  12. <p>
  13. <?= Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
  14. <?= Html::a('Создать фильтр', ['filter', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
  15. <?= Html::a('Удалить', ['delete', 'id' => $model->id], [
  16. 'class' => 'btn btn-danger',
  17. 'data' => [
  18. 'confirm' => 'Are you sure you want to delete this item?',
  19. 'method' => 'post',
  20. ],
  21. ]) ?>
  22. </p>
  23. <?= DetailView::widget([
  24. 'model' => $model,
  25. 'attributes' => [
  26. 'id',
  27. 'news_id',
  28. 'visible',
  29. 'message:ntext',
  30. 'ip_address',
  31. 'user_agent:ntext',
  32. [
  33. 'label' => 'User Agent - компактный',
  34. 'value' => md5( $model->user_agent )
  35. ],
  36. 'created_by_user_id',
  37. 'created_at',
  38. ],
  39. ]) ?>
  40. </div>