view.php 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. use common\models\Store;
  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\Store */
  8. $this->title = $model->name;
  9. $this->params['breadcrumbs'][] = ['label' => Yii::t('common', 'Stores'), 'url' => ['index']];
  10. $this->params['breadcrumbs'][] = $this->title;
  11. ?>
  12. <?= $this->render('../site/view_menu', [ 'model' => $model]) ?>
  13. <div class="box box-success">
  14. <div class="box-body">
  15. <?= DetailView::widget([
  16. 'model' => $model,
  17. 'attributes' => [
  18. 'id',
  19. 'user_id:user',
  20. 'proxy_user_id:user',
  21. 'name',
  22. 'code',
  23. 'address',
  24. [
  25. 'attribute' => 'logo',
  26. 'format' => 'raw',
  27. 'value' => function ($model){
  28. $images = [ // images at popup window of prettyPhoto galary
  29. 1 => [
  30. 'src' => $model->logo,
  31. 'title' => '',
  32. ],
  33. ];
  34. return $model->logo ? LightBoxWidget::widget([
  35. 'id' =>'cover', // id of plugin should be unique at page
  36. 'class' =>'galary', // class of plugin to define style
  37. 'height' =>'100px', // height of image visible in widget
  38. 'width' =>'100px', // width of image visible in widget
  39. 'images' => $images,
  40. ]) : null;
  41. }
  42. ],
  43. [
  44. 'attribute' => 'license',
  45. 'format' => 'raw',
  46. 'value' => function ($model){
  47. $images = [ // images at popup window of prettyPhoto galary
  48. 1 => [
  49. 'src' => $model->license,
  50. 'title' => '',
  51. ],
  52. ];
  53. return $model->license ? LightBoxWidget::widget([
  54. 'id' =>'cover', // id of plugin should be unique at page
  55. 'class' =>'galary', // class of plugin to define style
  56. 'height' =>'100px', // height of image visible in widget
  57. 'width' =>'100px', // width of image visible in widget
  58. 'images' => $images,
  59. ]) : null;
  60. }
  61. ],
  62. /*[
  63. 'attribute' => 'photos',
  64. 'format' => 'raw',
  65. 'value' => function ($model){
  66. $images = [];
  67. foreach ($model->photos as $index=>$photos) {
  68. $images[$index] = ['src'=>$photos, 'title'=>''];
  69. }
  70. return $model->photos ? LightBoxWidget::widget([
  71. 'id' =>'photos', // id of plugin should be unique at page
  72. 'class' =>'galary', // class of plugin to define style
  73. 'height' =>'100px', // height of image visible in widget
  74. 'width' =>'100px', // width of image visible in widget
  75. 'images' => $images,
  76. ]) : null;
  77. }
  78. ],*/
  79. 'contacts',
  80. 'tel',
  81. 'desc',
  82. 'created_at:datetime',
  83. 'updated_at:datetime',
  84. [
  85. 'attribute' => 'status',
  86. 'value' => Store::getStatusList($model->status),
  87. ],
  88. ],
  89. ]) ?>
  90. </div>
  91. </div>