‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton:
TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface

Public Member Functions

 getIcon ()
 
 setIcon (?Icon $icon)
 
 getLabel ()
 
 setLabel (string $label)
 
 getTitle ()
 
 setTitle (?string $title)
 
 getShowLabelText ()
 
 setShowLabelText (bool $showLabelText)
 
 addItem (DropDownItemInterface $item)
 
DropDownItemInterface[] getItems ()
 
bool isValid ()
 
string getType ()
 
 __toString ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface
string render ()
 

Protected Attributes

Icon $icon = null
 
string $label = ''
 
string $title = null
 
array $items = []
 
bool $showLabelText = false
 

Detailed Description

DropDownButton

This button type is a container for dropdown items. It will render a dropdown containing all items attached to it. There are different kinds available, each item needs to implement the DropDownItemInterface. When this type contains elements of type DropDownRadio it will use the icon of the first active item of this type.

$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); $dropDownButton = $buttonBar->makeDropDownButton() ->setLabel('Dropdown') ->setTitle('Save') ->setIcon($this->iconFactory->getIcon('actions-heart')) ->getShowLabelText(true) ->addItem( GeneralUtility::makeInstance(DropDownItem::class) ->setLabel('Item') ->setHref('#') ); $buttonBar->addButton($dropDownButton, ButtonBar::BUTTON_POSITION_RIGHT, 2);

Definition at line 47 of file DropDownButton.php.

Member Function Documentation

◆ __toString()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::__toString ( )

◆ addItem()

◆ getIcon()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::getIcon ( )

◆ getItems()

DropDownItemInterface [] TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::getItems ( )

◆ getLabel()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::getLabel ( )

◆ getShowLabelText()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::getShowLabelText ( )

◆ getTitle()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::getTitle ( )

◆ getType()

string TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::getType ( )
Returns
‪string

Implements TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface.

Definition at line 137 of file DropDownButton.php.

◆ isValid()

◆ setIcon()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::setIcon ( ?Icon  $icon)

◆ setLabel()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::setLabel ( string  $label)

◆ setShowLabelText()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::setShowLabelText ( bool  $showLabelText)

◆ setTitle()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::setTitle ( ?string  $title)

Member Data Documentation

◆ $icon

Icon TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::$icon = null
protected

◆ $items

array TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::$items = []
protected

◆ $label

◆ $showLabelText

bool TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::$showLabelText = false
protected

◆ $title

string TYPO3\CMS\Backend\Template\Components\Buttons\DropDownButton::$title = null
protected