ListGroup
Helper for ordered and unordered lists
- Full name:
\TwbsHelper\View\Helper\ListGroup - Parent class:
\TwbsHelper\View\Helper\HtmlList
Properties
allowedOptions
protected static $allowedOptions
- This property is static.
Methods
__invoke
Generates a 'List' element. Manage indentation of Xhtml markup
public __invoke(iterable $items, iterable $optionsAndAttributes = [], bool $escape = true): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$items | iterable | Array with the elements of the list |
$optionsAndAttributes | iterable | Attributes for the ul tag. |
$escape | bool | Escape the items. |
Return Value:
The list XHTML.
renderContainer
protected renderContainer(iterable $optionsAndAttributes, string $listContent, bool $escape): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$optionsAndAttributes | iterable | |
$listContent | string | |
$escape | bool |
prepareItemSpec
protected prepareItemSpec(mixed $item, iterable $optionsAndAttributes): iterable
Parameters:
| Parameter | Type | Description |
|---|---|---|
$item | mixed | |
$optionsAndAttributes | iterable |
renderListItemContent
protected renderListItemContent(iterable $item, string $itemContent, bool $escape): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$item | iterable | |
$itemContent | string | |
$escape | bool |
renderBadge
protected renderBadge(mixed $badgeOptions, string $itemContent, bool $escape): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$badgeOptions | mixed | |
$itemContent | string | |
$escape | bool |
renderCheckbox
protected renderCheckbox(mixed $elementSpec, string $itemContent): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$elementSpec | mixed | |
$itemContent | string |
Inherited methods
__invoke
Generates a 'List' element. Manage indentation of Xhtml markup
public __invoke(iterable $items, iterable $optionsAndAttributes = [], bool $escape = true): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$items | iterable | Array with the elements of the list |
$optionsAndAttributes | iterable | Attributes for the ol/ul tag. |
| If class attributes contains "list-inline", so the li will have the class "list-inline-item" | ||
$escape | bool | Escape the items. |
Return Value:
The list XHTML.
Throws:
InvalidArgumentException
getContainerClassesFromOptionsAndAttributes
protected getContainerClassesFromOptionsAndAttributes(iterable $optionsAndAttributes): array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$optionsAndAttributes | iterable |
renderContainer
protected renderContainer(iterable $optionsAndAttributes, string $listContent, bool $escape): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$optionsAndAttributes | iterable | |
$listContent | string | |
$escape | bool |
renderListItem
protected renderListItem(mixed $item, string $itemContent, iterable $optionsAndAttributes, bool $escape): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$item | mixed | |
$itemContent | string | |
$optionsAndAttributes | iterable | |
$escape | bool |
renderNestedListItem
protected renderNestedListItem(iterable $item, string $itemContent, iterable $optionsAndAttributes, bool $escape): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$item | iterable | |
$itemContent | string | |
$optionsAndAttributes | iterable | |
$escape | bool |
renderListItemContent
protected renderListItemContent(iterable $item, string $itemContent, bool $escape): string
Parameters:
| Parameter | Type | Description |
|---|---|---|
$item | iterable | |
$itemContent | string | |
$escape | bool |
prepareItemSpec
protected prepareItemSpec(mixed $item, iterable $optionsAndAttributes): iterable
Parameters:
| Parameter | Type | Description |
|---|---|---|
$item | mixed | |
$optionsAndAttributes | iterable |
getListItemClassesFromOptionsAndAttributes
protected getListItemClassesFromOptionsAndAttributes(iterable $optionsAndAttributes): array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$optionsAndAttributes | iterable |