amp-gallery.php 880 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * @var $this \yii\web\View
  4. * @var $gallery \app\models\front\Gallery
  5. */
  6. use yii\helpers\Html;
  7. use yii\helpers\Url;
  8. ?>
  9. <?php if($gallery instanceof \app\models\front\Gallery && count($gallery->getBehavior('galleryBehavior')->getImages())>0 ):?>
  10. <amp-carousel width="450" height="300" layout="responsive" type="slides" role="region" aria-label="<?=Html::encode($gallery->name)?>" >
  11. <?php
  12. foreach($gallery->getBehavior('galleryBehavior')->getImages() as $image):/** @var $image \app\forks\galleryManager\GalleryImage */ ?>
  13. <amp-img src="https://www.amic.ru/<?= $image->getUrl('original')?>" width="450" height="300" alt="<?=Html::encode($image->name)?>"></amp-img>
  14. <?php endforeach;?>
  15. </amp-carousel>
  16. <div class="amp-img-title"><?=$gallery->name?></div>
  17. <?php endif;?>