TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Backend\Template\Components\Buttons\InputButton Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Template\Components\Buttons\InputButton:
TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface TYPO3\CMS\Backend\Template\Components\AbstractControl TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface

Public Member Functions

 getName ()
 
 setName ($name)
 
 getValue ()
 
 setValue ($value)
 
 getForm ()
 
 setForm ($form)
 
 isValid ()
 
 render ()
 
 __toString ()
 
- Public Member Functions inherited from TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton
 getShowLabelText ()
 
 setShowLabelText ($showLabelText)
 
 getIcon ()
 
 getType ()
 
 setIcon (Icon $icon)
 
 isValid ()
 
 __toString ()
 
 render ()
 
- Public Member Functions inherited from TYPO3\CMS\Backend\Template\Components\AbstractControl
 getClasses ()
 
 getTitle ()
 
 getDataAttributes ()
 
 getOnClick ()
 
 setClasses ($classes)
 
 setTitle ($title)
 
 setDataAttributes (array $dataAttributes)
 
 setOnClick ($onClick)
 

Protected Attributes

 $name = ''
 
 $value = ''
 
 $form = ''
 
- Protected Attributes inherited from TYPO3\CMS\Backend\Template\Components\Buttons\AbstractButton
 $icon
 
 $type
 
 $showLabelText = false
 
- Protected Attributes inherited from TYPO3\CMS\Backend\Template\Components\AbstractControl
 $classes = ''
 
 $title = ''
 
 $dataAttributes = []
 
 $onClick = ''
 

Detailed Description

InputButton

This button type renders a HTML tag <button> and takes the HTML attributes name and value as additional attributes to those defined in AbstractButton.

Since we no longer want to have any <input type="submit"> in the TYPO3 core you should use this button type to send forms

EXAMPLE USAGE TO ADD A 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', Icon::SIZE_SMALL)) ->setTitle('Save'); $buttonBar->addButton($saveButton, ButtonBar::BUTTON_POSITION_LEFT, 1);

Definition at line 36 of file InputButton.php.

Member Function Documentation

◆ __toString()

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

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

Returns
string

Implements TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface.

Definition at line 180 of file InputButton.php.

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

◆ getForm()

TYPO3\CMS\Backend\Template\Components\Buttons\InputButton::getForm ( )

◆ getName()

TYPO3\CMS\Backend\Template\Components\Buttons\InputButton::getName ( )

◆ getValue()

TYPO3\CMS\Backend\Template\Components\Buttons\InputButton::getValue ( )

◆ isValid()

◆ render()

◆ setForm()

TYPO3\CMS\Backend\Template\Components\Buttons\InputButton::setForm (   $form)
Parameters
string$form
Returns
InputButton

Definition at line 118 of file InputButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\InputButton\$form.

◆ setName()

TYPO3\CMS\Backend\Template\Components\Buttons\InputButton::setName (   $name)

Set name

Parameters
string$nameName attribute
Returns
InputButton

Definition at line 76 of file InputButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\InputButton\$name.

◆ setValue()

TYPO3\CMS\Backend\Template\Components\Buttons\InputButton::setValue (   $value)

Set value

Parameters
string$valueValue attribute
Returns
InputButton

Definition at line 99 of file InputButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\InputButton\$value.

Member Data Documentation

◆ $form

TYPO3\CMS\Backend\Template\Components\Buttons\InputButton::$form = ''
protected

◆ $name

TYPO3\CMS\Backend\Template\Components\Buttons\InputButton::$name = ''
protected

◆ $value