AbstractButton

class \TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton

Extends
AbstractControl
Implements
ButtonInterface

Base class for all button types in the backend document header.

Provides common functionality for buttons including icon handling, label text display, and disabled state management.

This class extends AbstractControl (providing title, classes, data attributes) and implements ButtonInterface (providing validation, type identification, and rendering).

Tags

see
ButtonInterface
see
AbstractControl

Table of Contents

Interfaces

ButtonInterface
Interface for buttons in the document header.

Properties

$attributes  : array
Attributes for the button
$classes  : string
CSS classes to apply to the rendered element
$dataAttributes  : array<string, string>
HTML data-* attributes for the control
$disabled  : bool
Whether the button is in disabled state
$icon  : Icon|null
Optional icon to display on the button
$showLabelText  : bool
Whether to show the button's label text (from title property).
$title  : string
Title/label text for the control

Methods

__toString()  : string
Implementation from ButtonInterface This object is an abstract, so no implementation is necessary
getAttributes()  : array<string, string>
getClasses()  : string
getDataAttributes()  : array
getIcon()  : Icon|null
getShowLabelText()  : bool
getTitle()  : string
getType()  : string
Returns the fully qualified class name as the component type identifier.
isDisabled()  : bool
isValid()  : bool
Implementation from ButtonInterface This object is an abstract, so no implementation is necessary
render()  : string
Implementation from ButtonInterface This object is an abstract, so no implementation is necessary
setAttributes()  : static
setClasses()  : static
setDataAttributes()  : static
setDisabled()  : static
setIcon()  : static
setShowLabelText()  : static
setTitle()  : static

Properties

$attributes

Attributes for the button

protected array $attributes = []

$classes

CSS classes to apply to the rendered element

protected string $classes = ''

$dataAttributes

HTML data-* attributes for the control

protected array<string, string> $dataAttributes = []

Key-value pairs (e.g., ['action' => 'save'])

$disabled

Whether the button is in disabled state

protected bool $disabled = false

$icon

Optional icon to display on the button

protected Icon|null $icon = null

$showLabelText

Whether to show the button's label text (from title property).

protected bool $showLabelText = false

If false, only the icon is shown (label is used for title attribute).

$title

Title/label text for the control

protected string $title = ''

Methods

__toString()

Implementation from ButtonInterface This object is an abstract, so no implementation is necessary

public __toString() : string

Return values

string

getAttributes()

public getAttributes() : array<string, string>

Return values

array<string, string>

getClasses()

public getClasses() : string

Return values

string

getDataAttributes()

public getDataAttributes() : array

Return values

array

getShowLabelText()

public getShowLabelText() : bool

Return values

bool

getTitle()

public getTitle() : string

Return values

string

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

isDisabled()

public isDisabled() : bool

Return values

bool

isValid()

Implementation from ButtonInterface This object is an abstract, so no implementation is necessary

public isValid() : bool

Return values

bool —

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

render()

Implementation from ButtonInterface This object is an abstract, so no implementation is necessary

public render() : string

Return values

string

setAttributes()

public setAttributes(array<string, string> $attributes) : static

Parameters

$attributes : array<string, string>

Return values

static

setClasses()

public setClasses(string $classes) : static

Parameters

$classes : string

Return values

static

setDataAttributes()

public setDataAttributes(array $dataAttributes) : static

Parameters

$dataAttributes : array

Return values

static

setDisabled()

public setDisabled(bool $disabled) : static

Parameters

$disabled : bool

Return values

static

setIcon()

public setIcon(Icon|null $icon) : static

Parameters

$icon : Icon|null

Return values

static

setShowLabelText()

public setShowLabelText(bool $showLabelText) : static

Parameters

$showLabelText : bool

Return values

static

setTitle()

public setTitle(string $title) : static

Parameters

$title : string

Return values

static
On this page