File: D:/HostingSpaces/SBogers14/coeveringmatrijzen.nl/app/Coevering/Galleries/GalleryService.php
<?php
namespace Coevering\Galleries;
class GalleryService
{
protected $images;
protected $alt;
/**
* @param $images
*/
public function setImages($images){
$this->images = $images;
}
/**
* @param $alt
*/
public function setAlt($alt){
$this->alt = $alt;
}
/**
* @return string
*/
public function createSlider()
{
$output = '';
foreach($this->images as $key => $imageUrl)
{
$output .= '<li>
<img src="'.$imageUrl.'" alt="'.$this->alt.'" />
</li>';
}
return $output;
}
/**
* @return string
*/
public function createCounter()
{
$output = '';
foreach($this->images as $key => $imageUrl)
{
$output .= '<li id="counter'.($key+1).'"';
if($key == 0) $output .= ' class="active"';
$output .= '>'.($key+1).'</li>';
}
return $output;
}
}