‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Template\Components\Buttons\SplitButton Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Template\Components\Buttons\SplitButton:
TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton TYPO3\CMS\Backend\Template\Components\AbstractControl TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface

Public Member Functions

$this addItem (AbstractButton $item, $primaryAction=false)
 
array getButton ()
 
bool isValid ()
 
string render ()
 
 __toString ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton
bool getShowLabelText ()
 
$this setShowLabelText ($showLabelText)
 
Icon getIcon ()
 
string getType ()
 
$this setIcon (Icon $icon)
 
 isDisabled ()
 
 setDisabled (bool $disabled)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Backend\Template\Components\AbstractControl
string getClasses ()
 
string getTitle ()
 
array getDataAttributes ()
 
$this setClasses ($classes)
 
$this setTitle ($title)
 
$this setDataAttributes (array $dataAttributes)
 

Protected Attributes

bool $containsPrimaryAction = false
 
array $items = array( )
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton
Icon $icon
 
bool $showLabelText = false
 
bool $disabled = false
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Backend\Template\Components\AbstractControl
string $classes = ''
 
string $title = ''
 
array $dataAttributes = array( )
 

Detailed Description

SplitButton

This button type renders a bootstrap split button. It takes multiple button objects as parameters

EXAMPLE USAGE TO ADD A SPLIT BUTTON TO THE FIRST BUTTON GROUP IN THE LEFT BAR:

$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();

$saveButton = $buttonBar->makeInputButton() ->setName('save') ->setValue('1') ->setIcon($this->iconFactory->getIcon('actions-document-save', IconSize::SMALL)) ->setTitle('Save');

$saveAndCloseButton = $buttonBar->makeInputButton() ->setName('save_and_close') ->setValue('1') ->setTitle('Save and close') ->setIcon($this->iconFactory->getIcon('actions-document-save-close', IconSize::SMALL));

$saveAndShowPageButton = $buttonBar->makeInputButton() ->setName('save_and_show') ->setValue('1') ->setTitle('Save and show') ->setIcon($this->iconFactory->getIcon('actions-document-save-view', IconSize::SMALL));

$splitButtonElement = $buttonBar->makeSplitButton() ->addItem($saveButton, TRUE) ->addItem($saveAndCloseButton) ->addItem($saveAndShowPageButton);

Definition at line 51 of file SplitButton.php.

Member Function Documentation

◆ __toString()

TYPO3\CMS\Backend\Template\Components\Buttons\SplitButton::__toString ( )

Magic method so Fluid can access a button via {button}

Reimplemented from TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton.

Definition at line 213 of file SplitButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\SplitButton\render().

◆ addItem()

$this TYPO3\CMS\Backend\Template\Components\Buttons\SplitButton::addItem ( AbstractButton  $item,
  $primaryAction = false 
)

Adds an instance of any button to the split button

Parameters
AbstractButton$item‪ButtonObject to add
bool$primaryAction‪Is the button the primary action?
Exceptions

Definition at line 76 of file SplitButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton\getType(), and TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton\isValid().

◆ getButton()

array TYPO3\CMS\Backend\Template\Components\Buttons\SplitButton::getButton ( )

◆ isValid()

bool TYPO3\CMS\Backend\Template\Components\Buttons\SplitButton::isValid ( )

Validates the current button

Returns
‪bool

Reimplemented from TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton.

Definition at line 118 of file SplitButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\SplitButton\getButton().

◆ render()

Member Data Documentation

◆ $containsPrimaryAction

bool TYPO3\CMS\Backend\Template\Components\Buttons\SplitButton::$containsPrimaryAction = false
protected

Internal var that determines whether the split button has received any primary actions yet

Definition at line 58 of file SplitButton.php.

◆ $items

array TYPO3\CMS\Backend\Template\Components\Buttons\SplitButton::$items = array( )
protected