view.php 934 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Author: lf
  4. * Blog: https://blog.feehi.com
  5. * Email: job@feehi.com
  6. * Created at: 2018-02-24 22:33
  7. */
  8. use common\libs\Constants;
  9. use yii\widgets\DetailView;
  10. /** @var $model common\models\Comment */
  11. ?>
  12. <?=DetailView::widget([
  13. 'model' => $model,
  14. 'attributes' => [
  15. 'id',
  16. 'aid',
  17. [
  18. 'label' => Yii::t('app', 'Article Title'),
  19. 'attribute' => 'aid',
  20. 'value' => function($model){
  21. return $model->article->title;
  22. }
  23. ],
  24. 'uid',
  25. 'admin_id',
  26. 'reply_to',
  27. 'nickname',
  28. 'email',
  29. 'website_url',
  30. 'content',
  31. 'ip',
  32. [
  33. 'attribute' => 'status',
  34. 'value' => function($model){
  35. return Constants::getCommentStatusItems($model->status);
  36. }
  37. ],
  38. 'created_at:datetime',
  39. 'updated_at:datetime',
  40. ]
  41. ])?>