DropDownHeader implements DropDownItemInterface

This dropdown item type renders a noninteractive text element to group items and gives more meaning to a set of options.

Example:

$item = GeneralUtility::makeInstance(DropDownHeader::class)->setLabel('Label');
$dropDownButton->addItem($item);

Table of Contents

Interfaces

DropDownItemInterface
Interface for dropdown items that can be added to a DropDownButton.

Properties

$label  : string|null

Methods

__toString()  : string
getLabel()  : string|null
getType()  : string
Returns the fully qualified class name as the component type identifier.
isValid()  : bool
Validates whether the component is properly configured and can be rendered.
render()  : string
Renders the component as an HTML string.
setLabel()  : static

Properties

Methods

__toString()

public __toString() : string
Return values
string

getLabel()

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

getType()

Returns the fully qualified class name as the component type identifier.

public getType() : string

This is used to identify the specific component type in validation and rendering.

Return values
string

The fully qualified class name (e.g., 'TYPO3\CMS\Backend\Template\Components\Buttons\LinkButton')

isValid()

Validates whether the component is properly configured and can be rendered.

public isValid() : bool

Each implementing class defines its own validation rules (e.g., required fields).

Return values
bool

True if the component is valid and can be rendered, false otherwise

render()

Renders the component as an HTML string.

public render() : string

This method should only be called after validating the component with isValid(). The returned HTML is ready to be output to the browser.

Return values
string

The rendered HTML markup

setLabel()

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

        
On this page

Search results