‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownRadio Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownRadio:
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 = []
 
bool $active = false
 

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

DropDownRadio

This dropdown item type renders an element with an active state. Use this element to display a radio-like selection of a state. When set to active, it will show a dot in front of the icon and text to indicate that this is the current selection.

At least 2 of these items need to exist within a dropdown button, so a user has a choice of a state to select.

Example: Viewmode -> List / Tiles

$item = GeneralUtility::makeInstance(DropDownRadio::class) ->setHref('#') ->setActive(true) ->setLabel('List') ->setTitle('List') ->setIcon($this->iconFactory->getIcon('actions-viewmode-list')) ->setAttributes(['data-type' => 'list']); $dropDownButton->addItem($item);

$item = GeneralUtility::makeInstance(DropDownRadio::class) ->setHref('#') ->setActive(false) ->setLabel('Tiles') ->setTitle('Tiles') ->setIcon($this->iconFactory->getIcon('actions-viewmode-tiles')) ->setAttributes(['data-type' => 'tiles']); $dropDownButton->addItem($item);

Definition at line 53 of file DropDownRadio.php.

Member Function Documentation

◆ isActive()

◆ render()

◆ setActive()

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

Member Data Documentation

◆ $active

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