‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownToggle Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownToggle:
TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\AbstractDropDownItem TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownItemInterface

Public Member Functions

 isActive ()
 
 setActive (bool $active)
 
 render ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\AbstractDropDownItem
 setTag (string $tag)
 
 getTag ()
 
 getIcon ()
 
 setIcon (?Icon $icon)
 
 getLabel ()
 
 setLabel (?string $label)
 
 getTitle ()
 
 setTitle (?string $title)
 
 getHref ()
 
 setHref (?string $href)
 
 setAttributes (array $attributes)
 
 isValid ()
 
 getType ()
 
 __toString ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownItemInterface
 getType ()
 
 isValid ()
 

Protected Attributes

bool $active = false
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\AbstractDropDownItem
string $tag = 'a'
 
Icon $icon = null
 
string $label = null
 
string $title = null
 
string $href = null
 
array $attributes = []
 

Additional Inherited Members

- ‪Public Attributes inherited from ‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\AbstractDropDownItem
array< string, function getAttributes():array { return $this-> attributes
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\AbstractDropDownItem
 getAttributesString ()
 
 getRenderedIcon ()
 

Detailed Description

DropDownToggle

This dropdown item type renders an element with an active state. When set to active, it will show a checkmark in front of the icon and text to indicate the current state.

$item = GeneralUtility::makeInstance(DropDownToggle::class) ->setHref('#') ->setActive(true) ->setLabel('Label') ->setTitle('Title') ->setIcon($this->iconFactory->getIcon('actions-heart')) ->setAttributes(['data-value' => '123']); $dropDownButton->addItem($item);

Definition at line 38 of file DropDownToggle.php.

Member Function Documentation

◆ isActive()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownToggle::isActive ( )

◆ render()

◆ setActive()

TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownToggle::setActive ( bool  $active)

Member Data Documentation

◆ $active

bool TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownToggle::$active = false
protected