DropDownRadio extends AbstractDropDownItem implements DropDownItemInterface

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);

Table of Contents

Interfaces

DropDownItemInterface

Properties

$active  : bool
$attributes  : array<string|int, mixed>
$href  : string|null
$icon  : Icon|null
$label  : string|null
$tag  : string
$title  : string|null

Methods

__toString()  : string
getAttributes()  : array<string, string>
getHref()  : string|null
getIcon()  : Icon|null
getLabel()  : string|null
getTag()  : string
getTitle()  : string|null
getType()  : string
isActive()  : bool
isValid()  : bool
render()  : string
setActive()  : self
setAttributes()  : self
setHref()  : self
setIcon()  : self
setLabel()  : self
setTag()  : self
setTitle()  : self
getAttributesString()  : string
getRenderedIcon()  : string

Properties

$attributes

protected array<string|int, mixed> $attributes = []

Methods

__toString()

public __toString() : string
Return values
string

getAttributes()

public getAttributes() : array<string, string>
Return values
array<string, string>

getHref()

public getHref() : string|null
Return values
string|null

getLabel()

public getLabel() : string|null
Return values
string|null

getTag()

public getTag() : string
Return values
string

getTitle()

public getTitle() : string|null
Return values
string|null

getType()

public getType() : string
Return values
string

isActive()

public isActive() : bool
Return values
bool

isValid()

public isValid() : bool
Return values
bool

render()

public render() : string
Return values
string

setActive()

public setActive(bool $active) : self
Parameters
$active : bool
Return values
self

setAttributes()

public setAttributes(array<string, string> $attributes) : self
Parameters
$attributes : array<string, string>
Return values
self

setHref()

public setHref(string|null $href) : self
Parameters
$href : string|null
Return values
self

setIcon()

public setIcon(Icon|null $icon) : self
Parameters
$icon : Icon|null
Return values
self

setLabel()

public setLabel(string|null $label) : self
Parameters
$label : string|null
Return values
self

setTag()

public setTag(string $tag) : self
Parameters
$tag : string
Return values
self

setTitle()

public setTitle(string|null $title) : self
Parameters
$title : string|null
Return values
self

getAttributesString()

protected getAttributesString() : string
Return values
string

getRenderedIcon()

protected getRenderedIcon() : string
Return values
string

        
On this page

Search results