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

Public Member Functions

 getHref ()
 
 setHref ($href)
 
 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

 $href = ''
 
- Protected Attributes inherited from AbstractButton
 $icon
 
 $type
 
 $showLabelText = false
 
- Protected Attributes inherited from AbstractControl
 $classes = ''
 
 $title = ''
 
 $dataAttributes = []
 
 $onClick = ''
 

Detailed Description

LinkButton

This button type renders a regular anchor tag with TYPO3s way to render a button control.

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

$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); $saveButton = $buttonBar->makeLinkButton() ->setHref('#') ->setDataAttributes([ 'foo' => 'bar' ]) ->setIcon($this->iconFactory->getIcon('actions-document-save', Icon::SIZE_SMALL)) ->setTitle('Save'); $buttonBar->addButton($saveButton, ButtonBar::BUTTON_POSITION_LEFT, 1);

Definition at line 35 of file LinkButton.php.

Member Function Documentation

__toString ( )

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

Returns
string

Implements ButtonInterface.

Definition at line 122 of file LinkButton.php.

References LinkButton\render().

getHref ( )

Get href

Returns
string

Definition at line 49 of file LinkButton.php.

References LinkButton\$href.

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

isValid ( )

Validates the current button

Returns
bool

Implements ButtonInterface.

Definition at line 72 of file LinkButton.php.

References LinkButton\getHref(), AbstractButton\getIcon(), AbstractControl\getTitle(), and AbstractButton\getType().

render ( )

Renders the markup for the button

Returns
string

Implements ButtonInterface.

Definition at line 90 of file LinkButton.php.

References AbstractControl\$onClick, AbstractControl\$title, AbstractControl\getClasses(), LinkButton\getHref(), AbstractButton\getIcon(), and AbstractControl\getTitle().

Referenced by LinkButton\__toString().

setHref (   $href)

Set href

Parameters
string$hrefHREF attribute
Returns
LinkButton

Definition at line 61 of file LinkButton.php.

References LinkButton\$href.

Member Data Documentation

$href = ''
protected

Definition at line 42 of file LinkButton.php.

Referenced by LinkButton\getHref(), and LinkButton\setHref().