Skip to main content

Carousel

Helper for rendering carousels


Constants​

ConstantVisibilityTypeValue
CONTROL_PREVIOUSpublic'prev'
CONTROL_NEXTpublic'next'

Properties​

allowedOptions​

protected static $allowedOptions
  • This property is static.

allowedSlideOptions​

protected static $allowedSlideOptions
  • This property is static.

Methods​

__invoke​

Generates a 'carousel' element

public __invoke(array $slides, array $optionsAndAttributes = [], bool $escape = true): string

Parameters:

ParameterTypeDescription
$slidesarrayThe slides of the carousel
$optionsAndAttributesarrayHtml attributes of the "<div>" element
$escapeboolTrue espace html content. Default True

Return Value:

The carousel XHTML.


parseSlides​

protected parseSlides(iterable $slides): mixed

Parameters:

ParameterTypeDescription
$slidesiterable

renderSlides​

protected renderSlides(array $slides, bool $escape = true): mixed

Parameters:

ParameterTypeDescription
$slidesarray
$escapebool

renderSlide​

protected renderSlide(iterable $slide, bool $escape = true): mixed

Parameters:

ParameterTypeDescription
$slideiterable
$escapebool

renderSlideCaption​

protected renderSlideCaption(mixed $captionContent, bool $escape = true): mixed

Parameters:

ParameterTypeDescription
$captionContentmixed
$escapebool

renderSlideContainer​

protected renderSlideContainer(iterable $slide, string $slideContent, bool $escape): string

Parameters:

ParameterTypeDescription
$slideiterable
$slideContentstring
$escapebool

renderIndicators​

protected renderIndicators(string $id, array $slides, bool $escape = true): string

Parameters:

ParameterTypeDescription
$idstring
$slidesarray
$escapebool

renderIndicator​

protected renderIndicator(string $id, int $iterator, mixed $slide, bool $escape = true): string

Parameters:

ParameterTypeDescription
$idstring
$iteratorint
$slidemixed
$escapebool

renderControls​

protected renderControls(string $id, mixed $controls, bool $escape = true): string

Parameters:

ParameterTypeDescription
$idstring
$controlsmixed
$escapebool

renderControl​

protected renderControl(string $id, string $control, string $label, bool $escape = true): string

Parameters:

ParameterTypeDescription
$idstring
$controlstring
$labelstring
$escapebool