Skip to main content

CarouselDto

Description

A simple carousel with a service facilitating data recovery, no matter where it comes from (FTP, Database, API, etc.)

Breadcrumb

{{ component('proglab_carousel', {
id: 'carousel1',
with_controls: true,
control_next: 'Next',
control_previous: 'Previous',
with_indicators: true,
fade: true,
dark: false
}) }}

How to use

create a proglab_components.yaml in your config/packages directory

services:
Proglab\Components\Service\CarouselServiceAbstract:
class: App\Service\CarouselService
public: true
autoconfigure: true
autowire: true

create a class in src/Service/CarouselService.php

namespace App\Service;

use Proglab\Components\Dto\Carousel\Caption;
use Proglab\Components\Dto\Carousel\Image;
use Proglab\Components\Service\CarouselServiceAbstract;

class CarouselService extends CarouselServiceAbstract
{

/**
* @return Image[]
*/
public function findAll(): array
{
...
}
}

this function must return a array of Proglab\Components\Dto\Carousel\Image

Parameters

General

ParameterTypeDescriptionDefault Values
idstringThe id of the carouselnull
with_controlsboolSee controlsfalse
control_next?stringThe label for next'Next'
control_previous?stringThe label for previous'Previous'
with_indicatorsboolSee indicatorsfalse
fadeboolFade effectfalse
darkboolControls in dark modefalse

Images

ParameterTypeDescriptionDefault Values
urlstringRequirednull
altstringThe image alternativenull
captionarrayThe image caption (see next)null
interval?stringThe image slide intervalnull

Caption

ParameterTypeDescriptionDefault Values
titlestringThe title of the captionnull
textstringThe text of the captionnull

Usage/Examples

{{ component('proglab_carousel_dto') }}