GenericButton implements ButtonInterface
GenericButton
$button = GeneralUtility::makeInstance(GenericButton::class) ->setTag('a') ->setHref('#') ->setLabel('Label') ->setTitle('Title') ->setIcon($this->iconFactory->getIcon('actions-heart')) ->setAttributes(['data-value' => '123']);
Table of Contents
Interfaces
- ButtonInterface
- Interface for buttons
Properties
- $attributes : array<string|int, mixed>
- $classes : string
- $href : string|null
- $icon : Icon|null
- $label : string
- $showLabelText : bool
- $tag : string
- $title : string|null
Methods
- __toString() : string
- getAttributes() : array<string, string>
- getClasses() : string
- getHref() : string|null
- getIcon() : Icon|null
- getLabel() : string|null
- getShowLabelText() : bool
- getTag() : string
- getTitle() : string|null
- getType() : string
- Returns the fully qualified class name of the button as a string
- isValid() : bool
- Validates all set parameters of a button.
- render() : string
- Renders the markup for the button
- setAttributes() : self
- setClasses() : self
- setHref() : self
- setIcon() : self
- setLabel() : self
- setShowLabelText() : self
- setTag() : self
- setTitle() : self
- getAttributesString() : string
Properties
$attributes
protected
array<string|int, mixed>
$attributes
= []
$classes
protected
string
$classes
= ''
$href
protected
string|null
$href
= null
$icon
protected
Icon|null
$icon
= null
$label
protected
string
$label
= ''
$showLabelText
protected
bool
$showLabelText
= false
$tag
protected
string
$tag
= 'button'
$title
protected
string|null
$title
= null
Methods
__toString()
public
__toString() : string
Return values
stringgetAttributes()
public
getAttributes() : array<string, string>
Return values
array<string, string>getClasses()
public
getClasses() : string
Return values
stringgetHref()
public
getHref() : string|null
Return values
string|nullgetIcon()
public
getIcon() : Icon|null
Return values
Icon|nullgetLabel()
public
getLabel() : string|null
Return values
string|nullgetShowLabelText()
public
getShowLabelText() : bool
Return values
boolgetTag()
public
getTag() : string
Return values
stringgetTitle()
public
getTitle() : string|null
Return values
string|nullgetType()
Returns the fully qualified class name of the button as a string
public
getType() : string
Return values
stringisValid()
Validates all set parameters of a button.
public
isValid() : bool
Return values
boolrender()
Renders the markup for the button
public
render() : string
Return values
stringsetAttributes()
public
setAttributes(array<string, string> $attributes) : self
Parameters
- $attributes : array<string, string>
Return values
selfsetClasses()
public
setClasses(string $classes) : self
Parameters
- $classes : string
Return values
selfsetHref()
public
setHref(string|null $href) : self
Parameters
- $href : string|null
Return values
selfsetIcon()
public
setIcon(Icon|null $icon) : self
Parameters
- $icon : Icon|null
Return values
selfsetLabel()
public
setLabel(string|null $label) : self
Parameters
- $label : string|null
Return values
selfsetShowLabelText()
public
setShowLabelText(bool $showLabelText) : self
Parameters
- $showLabelText : bool
Return values
selfsetTag()
public
setTag(string $tag) : self
Parameters
- $tag : string
Return values
selfsetTitle()
public
setTitle(string|null $title) : self
Parameters
- $title : string|null
Return values
selfgetAttributesString()
protected
getAttributesString() : string