Skip to main content

Dropdown


Constants

ConstantVisibilityTypeValue
TYPE_ITEM_HEADERpublicstring'header'
TYPE_ITEM_DIVIDERpublicstring'---'
TYPE_ITEM_LINKpublicstring'link'
TYPE_ITEM_BUTTONpublicstring'button'
TYPE_ITEM_TEXTpublicstring'text'
TYPE_ITEM_HTMLpublicstring'html'

Properties

protected static array $dropdownItemTags
  • This property is static.

directions

protected static array $directions
  • This property is static.

Methods

__invoke

public __invoke(\Laminas\Form\ElementInterface|array $dropdown = null, bool $escape = true): \TwbsHelper\View\Helper\Dropdown|string

Parameters:

ParameterTypeDescription
$dropdown\Laminas\Form\ElementInterface|array
$escapeboolEscape the dropdown.

render

Render dropdown markup

public render(\Laminas\Form\ElementInterface|iterable $dropdown, bool $escape = true): string

Parameters:

ParameterTypeDescription
$dropdown\Laminas\Form\ElementInterface|iterable
$escapeboolEscape the dropdown.

createDropdown

protected createDropdown(\Laminas\Form\ElementInterface|iterable $dropdown): \Laminas\Form\ElementInterface

Parameters:

ParameterTypeDescription
$dropdown\Laminas\Form\ElementInterface|iterable

renderContainer

protected renderContainer(array $dropdownOptions, string $dropdownContent): string

Parameters:

ParameterTypeDescription
$dropdownOptionsarray
$dropdownContentstring

renderToggle

Render dropdown toggle markup

protected renderToggle(\Laminas\Form\ElementInterface $dropdown): string

Parameters:

ParameterTypeDescription
$dropdown\Laminas\Form\ElementInterface

Throws:

  • InvalidArgumentException

getToggleSplitElement

Retrieve dropdown toggle split element

protected getToggleSplitElement(\Laminas\Form\ElementInterface $dropdown): \Laminas\Form\ElementInterface|null

Parameters:

ParameterTypeDescription
$dropdown\Laminas\Form\ElementInterface

Throws:

  • InvalidArgumentException

renderMenuFromElement

protected renderMenuFromElement(\Laminas\Form\ElementInterface $dropdown, bool $escape = true): mixed

Parameters:

ParameterTypeDescription
$dropdown\Laminas\Form\ElementInterface
$escapebool

prepareMenuAttributes

protected prepareMenuAttributes(\Laminas\Form\ElementInterface $dropdown): \TwbsHelper\View\HtmlAttributesSet

Parameters:

ParameterTypeDescription
$dropdown\Laminas\Form\ElementInterface

getDropdownId

protected getDropdownId(\Laminas\Form\ElementInterface $dropdown): ?string

Parameters:

ParameterTypeDescription
$dropdown\Laminas\Form\ElementInterface

renderMenu

Render dropdown menu markup

public renderMenu(iterable $items, iterable $attributes = [], bool $escape = true): string

Parameters:

ParameterTypeDescription
$itemsiterableDropdown menu items
$attributesiterableDropdown menu attributes
$escapeboolEscape the dropdown menu.

Throws:

  • InvalidArgumentException

renderItem

Render dropdown list item markup

protected renderItem(array $itemOptions, bool $escape): string

Parameters:

ParameterTypeDescription
$itemOptionsarray
$escapebool

Throws:

  • InvalidArgumentException

getLabelFromItemOptions

protected getLabelFromItemOptions(iterable $itemOptions): mixed

Parameters:

ParameterTypeDescription
$itemOptionsiterable