HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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;
    }
}