Blame view

frontend/widgets/views/slider.php 806 Bytes
4253cbec   root   first commit
1
2
  <?php

  /* @var $slider Slider*/

50e38c82   Administrator   big commti
3
  use common\components\artboximage\ArtboxImageHelper;

4253cbec   root   first commit
4
5
6
  use common\models\Slider;

  use yii\helpers\Html;

  use yii\helpers\Url;

50e38c82   Administrator   big commti
7
  use yii\web\View;

4253cbec   root   first commit
8
9
  

  ?>

50e38c82   Administrator   big commti
10
11
12
  

  

  <div id="<?=$title?>" class="owl-carousel owl-theme">

4253cbec   root   first commit
13
      <?php foreach($slider->sliderImage as $image):

50e38c82   Administrator   big commti
14
15
16
17
18
  

  

      ?>

      <div class="item">

          <?= Html::img(ArtboxImageHelper::getImageSrc($image->imageUrl,'slider'))?>

4253cbec   root   first commit
19
      </div>

50e38c82   Administrator   big commti
20
21
22
  

  

  

4253cbec   root   first commit
23
24
  <?php endforeach; ?>

  </div>

4253cbec   root   first commit
25
26
27
  <?php

  $dur = $slider->duration ?  $slider->duration : 5000;

  $speed = $slider->speed ?  $slider->speed : 500;

50e38c82   Administrator   big commti
28
29
30
31
32
33
  $js="	$(\"#$title\").owlCarousel({

        navigation : true, // Show next and prev buttons

        slideSpeed : 300,

        paginationSpeed : 400,

        singleItem:true

  

4253cbec   root   first commit
34
35
       });";

  

50e38c82   Administrator   big commti
36
  $this->registerJs($js,View::POS_END);

4253cbec   root   first commit
37
38
  

  ?>