view.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\DetailView;
  4. /* @var $this yii\web\View */
  5. /* @var $model common\models\Article */
  6. $this->title = $model->title;
  7. $this->params['breadcrumbs'][] = ['label' => '人才', 'url' => ['index']];
  8. $this->params['breadcrumbs'][] = $this->title;
  9. ?>
  10. <div class="article-view">
  11. <p>
  12. <?= Html::a(Yii::t('common', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-success']) ?>
  13. <?= Html::a(Yii::t('common', 'Delete'), ['delete', 'id' => $model->id], [
  14. 'class' => 'btn btn-danger',
  15. 'data' => [
  16. 'confirm' => Yii::t('common', 'Are you sure you want to delete this item?'),
  17. 'method' => 'post',
  18. ],
  19. ]) ?>
  20. </p>
  21. <?= DetailView::widget([
  22. 'model' => $model,
  23. 'attributes' => [
  24. 'id',
  25. 'title',
  26. [
  27. 'attribute' => 'content',
  28. 'label' => '内容',
  29. 'value' => \yii\helpers\Markdown::process($model->data->content),
  30. 'format' => 'raw',
  31. ],
  32. 'category',
  33. 'created_at:datetime',
  34. 'updated_at:datetime',
  35. 'status',
  36. 'cover',
  37. ],
  38. ]) ?>
  39. </div>