Jak zrobic aby klikajac na jeden obrazek leciala nam galeria? Mam tak:

  1. <?php
  2. $images = glob($dirPath."/".$offer['id']."/*.jpg");
  3. foreach($images as $image): ?>
  4. <a href="#" data-lightbox="<?php echo $image; ?>" data-gallery-id="gallery" data-frame="fullscreen-lb" data-caption="<?php echo $offer -> $language -> title; ?>">
  5. <div class="col-sm-12 image" style="background-image: url(<?php echo $images[0]; ?>);"></div>
  6. <?php endforeach ?>
  7. </a>


ok udalo sie jakos, nie wime cyz dobrze ale dziala

  1. <?php
  2. if (count(glob($dirPath."/".$offer['id']."/*.jpg")) != 0)
  3. {
  4. $images = glob($dirPath."/".$offer['id']."/*.jpg");
  5.  
  6. echo "
  7. <a href=\"#\" data-lightbox=\"".$images[0]."\" data-gallery-id=\"gallery\" data-frame=\"fullscreen-lb\" data-caption=\"".$offer -> $language -> title."\">
  8. <div class=\"col-sm-12 image\" style=\"background-image: url(".$images[0]."\"></div>
  9. </a>";
  10.  
  11. foreach($images as $key => $image)
  12. {
  13. if ($key > 0)
  14. {
  15. echo "<a href=\"#\" data-lightbox=\"".$image."\" data-gallery-id=\"gallery\" data-frame=\"fullscreen-lb\" data-caption=\"".$offer -> $language -> title."\"></a>";
  16. }
  17. }
  18. }
  19. ?>