view.php 738 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Author: lf
  4. * Blog: https://blog.feehi.com
  5. * Email: job@feehi.com
  6. * Created at: 2018-02-24 22:14
  7. */
  8. use yii\widgets\DetailView;
  9. /** @var $model common\models\Category */
  10. ?>
  11. <?=DetailView::widget([
  12. 'model' => $model,
  13. 'attributes' => [
  14. 'id',
  15. 'parent_id',
  16. [
  17. 'label' => Yii::t('app', 'Parent Category Name'),
  18. 'attribute' => 'parent_id',
  19. 'value' => function($model){
  20. return $model->parent === null ? '' : $model->parent->name;
  21. }
  22. ],
  23. 'name',
  24. 'alias',
  25. 'sort',
  26. 'template',
  27. 'article_template',
  28. 'remark',
  29. 'created_at:datetime',
  30. 'updated_at:datetime',
  31. ],
  32. ])?>