Contao Utils Bundle

AccordionUtil
in package

Table of Contents

Properties

$accordionSingleCache  : array<string|int, mixed>
$accordionStartStopCache  : array<string|int, mixed>
$contaoFramework  : ContaoFramework

Methods

__construct()  : mixed
structureAccordionSingle()  : void
Adds the following flags to the template data: - first - last - parentId.
structureAccordionStartStop()  : void
generateAccordionLevel()  : array<string|int, mixed>

Properties

$accordionSingleCache

private array<string|int, mixed> $accordionSingleCache

$accordionStartStopCache

private array<string|int, mixed> $accordionStartStopCache = []

Methods

__construct()

public __construct(ContaoFramework $contaoFramework) : mixed
Parameters
$contaoFramework : ContaoFramework

structureAccordionSingle()

Adds the following flags to the template data: - first - last - parentId.

public structureAccordionSingle(array<string|int, mixed> &$data[, string $prefix = 'accordion_' ]) : void

This is needed if your want to group multiple single accordion elements into an accordion wrapper like in bootstrap 4.

Parameters
$data : array<string|int, mixed>

Data describing the accordion. Usually this is taken from \Contao\Template::getData().

$prefix : string = 'accordion_'

The prefix for the flags

structureAccordionStartStop()

public structureAccordionStartStop(array<string|int, mixed> &$data[, string $prefix = 'accordion_' ]) : void
Parameters
$data : array<string|int, mixed>
$prefix : string = 'accordion_'

generateAccordionLevel()

private generateAccordionLevel(array<string|int, mixed> $elements[, int &$index = 0 ][, int $level = 0 ]) : array<string|int, mixed>
Parameters
$elements : array<string|int, mixed>
$index : int = 0
$level : int = 0
Return values
array<string|int, mixed>

        
On this page

Search results