DropDownToggle

class \TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownToggle

Extends
AbstractDropDownItem
Implements
DropDownItemInterface

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.

Example:

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

Table of Contents

Interfaces

DropDownItemInterface

Properties

$active  : bool
$attributes  : array
$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
setAttribute()  : self
setAttributes()  : self
setHref()  : self
setIcon()  : self
setLabel()  : self
setTag()  : self
setTitle()  : self
getAttributesString()  : string
getRenderedIcon()  : string

Properties

$attributes

protected array $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

setAttribute()

public setAttribute(string $name, string $value) : self

Parameters

$name : string
$value : string

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