Carousel
Helper for rendering carousels
- Full name:
\TwbsHelper\View\Helper\Carousel - Parent class:
\TwbsHelper\View\Helper\AbstractHtmlElement
Constants
| Constant | Visibility | Type | Value |
|---|---|---|---|
CONTROL_PREVIOUS | public | 'prev' | |
CONTROL_NEXT | public | '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:
| Parameter | Type | Description |
|---|---|---|
$slides | array | The slides of the carousel |
$optionsAndAttributes | array | Html attributes of the "<div>" element |
$escape | bool | True espace html content. Default True |
Return Value:
The carousel XHTML.
parseSlides
protected parseSlides(iterable $slides): mixed
Parameters:
| Parameter | Type | Description |
|---|---|---|
$slides | iterable |
renderSlides
protected renderSlides(array $slides, bool $escape = true): mixed
Parameters:
| Parameter | Type | Description |
|---|---|---|
$slides | array | |
$escape | bool |
renderSlide
protected renderSlide(iterable $slide, bool $escape = true): mixed
Parameters:
| Parameter | Type | Description |
|---|---|---|
$slide | iterable | |
$escape | bool |
renderSlideCaption
protected renderSlideCaption(mixed $captionContent, bool $escape = true): mixed
Parameters:
| Parameter | Type | Description |
|---|---|---|
$captionContent | mixed | |
$escape | bool |
renderSlideContainer
protected renderSlideContainer(iterable $slide, string $slideContent, bool $escape): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$slide | iterable | |
$slideContent | string | |
$escape | bool |
renderIndicators
protected renderIndicators(string $id, array $slides, bool $escape = true): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$id | string | |
$slides | array | |
$escape | bool |
renderIndicator
protected renderIndicator(string $id, int $iterator, mixed $slide, bool $escape = true): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$id | string | |
$iterator | int | |
$slide | mixed | |
$escape | bool |
renderControls
protected renderControls(string $id, mixed $controls, bool $escape = true): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$id | string | |
$controls | mixed | |
$escape | bool |
renderControl
protected renderControl(string $id, string $control, string $label, bool $escape = true): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$id | string | |
$control | string | |
$label | string | |
$escape | bool |