Skip to main content

DescriptionList

Helper for ordered and unordered lists


Methods

__invoke

Generates a 'Description List' element. Manage indentation of Xhtml markup

public __invoke(array $items = null, array $optionsAndAttributes = [], bool $escape = true): \TwbsHelper\View\Helper\DescriptionList|string

Parameters:

ParameterTypeDescription
$itemsarrayArray with the elements of the list
$optionsAndAttributesarrayAttributes for the ol/ul tag.
If class attributes contains "list-inline", so the li will have the class "list-inline-item"
$escapeboolEscape the items.

Throws:

  • InvalidArgumentException

render

Generates a 'Description List' element. Manage indentation of Xhtml markup

public render(array $items, array $optionsAndAttributes = [], bool $escape = true): string

Parameters:

ParameterTypeDescription
$itemsarrayArray with the elements of the list
$optionsAndAttributesarrayAttributes for the ol/ul tag.
If class attributes contains "list-inline", so the li will have the class "list-inline-item"
$escapeboolEscape the items.

Return Value:

The list XHTML.

Throws:

  • InvalidArgumentException

renderContainer

protected renderContainer(string $tag, iterable $optionsAndAttributes, string $listContent, bool $escape = true): mixed

Parameters:

ParameterTypeDescription
$tagstring
$optionsAndAttributesiterable
$listContentstring
$escapebool

renderListItem

protected renderListItem(mixed $itemKey, mixed $itemValue, iterable $optionsAndAttributes = [], bool $escape = true): string

Parameters:

ParameterTypeDescription
$itemKeymixed
$itemValuemixed
$optionsAndAttributesiterable
$escapebool

renderListItemTerm

protected renderListItemTerm(iterable $termOptionsAndAttributes, iterable $optionsAndAttributes = [], bool $escape = true): string

Parameters:

ParameterTypeDescription
$termOptionsAndAttributesiterable
$optionsAndAttributesiterable
$escapebool

renderListItemDetail

protected renderListItemDetail(iterable $detailOptionsAndAttributes, iterable $optionsAndAttributes = [], bool $escape = true): string

Parameters:

ParameterTypeDescription
$detailOptionsAndAttributesiterable
$optionsAndAttributesiterable
$escapebool