view.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. use common\models\Compere;
  3. use slavkovrn\lightbox\LightBoxWidget;
  4. use yii\helpers\Html;
  5. use yii\widgets\DetailView;
  6. /* @var $this yii\web\View */
  7. /* @var $model common\models\Compere */
  8. $this->title = $model->name;
  9. $this->params['breadcrumbs'][] = ['label' => Yii::t('common', 'Comperes'), 'url' => ['index']];
  10. $this->params['breadcrumbs'][] = $this->title;
  11. ?>
  12. <div class="box box-success">
  13. <div class="box-body">
  14. <?= DetailView::widget([
  15. 'model' => $model,
  16. 'attributes' => [
  17. 'id',
  18. [
  19. 'attribute' => 'cover',
  20. 'format' => 'raw',
  21. 'value' => function ($model) {
  22. $images = [ // images at popup window of prettyPhoto galary
  23. 1 => [
  24. 'src' => $model->cover,
  25. 'title' => '',
  26. ],
  27. ];
  28. return $model->cover ? LightBoxWidget::widget([
  29. 'id' => 'cover', // id of plugin should be unique at page
  30. 'class' => 'galary', // class of plugin to define style
  31. 'height' => '100px', // height of image visible in widget
  32. 'width' => '100px', // width of image visible in widget
  33. 'images' => $images,
  34. ]) : null;
  35. }
  36. ],
  37. 'name',
  38. 'desc',
  39. [
  40. 'attribute' => 'province',
  41. 'format' => 'raw',
  42. 'value' => function ($model) {
  43. return \common\models\Region::getNameById($model->province);
  44. },
  45. ],
  46. [
  47. 'attribute' => 'city',
  48. 'format' => 'raw',
  49. 'value' => function ($model) {
  50. return \common\models\Region::getNameById($model->city);
  51. },
  52. ],
  53. [
  54. 'attribute' => 'area',
  55. 'format' => 'raw',
  56. 'value' => function ($model) {
  57. return \common\models\Region::getNameById($model->area);
  58. },
  59. ],
  60. 'address',
  61. 'title',
  62. 'works',
  63. 'tel',
  64. 'created_at',
  65. 'updated_at',
  66. [
  67. 'attribute' => 'status',
  68. 'value' => function ($model) {
  69. return Compere::getStatusList($model->status);
  70. },
  71. ],
  72. ],
  73. ]) ?>
  74. </div>
  75. </div>