TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
InputButton Class Reference
Inheritance diagram for InputButton:
AbstractButton ButtonInterface AbstractControl ButtonInterface

Public Member Functions

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

Protected Attributes

 $name = ''
 
 $value = ''
 
 $form = ''
 
- Protected Attributes inherited from AbstractButton
 $icon
 
 $type
 
 $showLabelText = false
 
- Protected Attributes inherited from 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 ( )

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

Returns
string

Implements ButtonInterface.

Definition at line 180 of file InputButton.php.

References InputButton\render().

getForm ( )
Returns
string

Definition at line 108 of file InputButton.php.

References InputButton\$form.

Referenced by InputButton\render().

getName ( )

Get name

Returns
string

Definition at line 64 of file InputButton.php.

References InputButton\$name.

Referenced by InputButton\isValid(), and InputButton\render().

getValue ( )

Get value

Returns
string

Definition at line 87 of file InputButton.php.

References InputButton\$value.

Referenced by InputButton\isValid(), and InputButton\render().

isValid ( )

Validates the current button

Returns
bool

Implements ButtonInterface.

Definition at line 129 of file InputButton.php.

References AbstractButton\getIcon(), InputButton\getName(), AbstractControl\getTitle(), AbstractButton\getType(), and InputButton\getValue().

setForm (   $form)
Parameters
string$form
Returns
InputButton

Definition at line 118 of file InputButton.php.

References InputButton\$form.

setName (   $name)

Set name

Parameters
string$nameName attribute
Returns
InputButton

Definition at line 76 of file InputButton.php.

References InputButton\$name.

setValue (   $value)

Set value

Parameters
string$valueValue attribute
Returns
InputButton

Definition at line 99 of file InputButton.php.

References InputButton\$value.

Member Data Documentation

$form = ''
protected

Definition at line 57 of file InputButton.php.

Referenced by InputButton\getForm(), and InputButton\setForm().

$name = ''
protected

Definition at line 43 of file InputButton.php.

Referenced by InputButton\getName(), and InputButton\setName().

$value = ''
protected

Definition at line 50 of file InputButton.php.

Referenced by InputButton\getValue(), InputButton\render(), and InputButton\setValue().