Skip to main content

FormButton


  • Full name: \TwbsHelper\Form\View\Helper\FormButton
  • Parent class: FormButton

Constants

ConstantVisibilityTypeValue
POSITION_PREPENDpublic'prepend'
POSITION_APPENDpublic'append'

Methods

__invoke

Invoke helper as functor

public __invoke(\Laminas\Form\ElementInterface|null $element = null, null|string $buttonContent = null): string|\TwbsHelper\Form\View\Helper\FormButton

Proxies to

  • See: .

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface|null
$buttonContentnull|string

renderSpec

Renders a button from an array specification

public renderSpec(array $elementSpec, ?string $buttonContent = null): string

Parameters:

ParameterTypeDescription
$elementSpecarray
$buttonContent?string

See Also:

  • \TwbsHelper\Form\View\Helper\FormButton::render()

getElementFromSpec

protected getElementFromSpec(array $elementSpec): \Laminas\Form\ElementInterface

Parameters:

ParameterTypeDescription
$elementSpecarray

render

Accept following extra options:

  • string variant: 'danger', 'dark', 'info', 'light', 'link', 'primary', 'secondary', 'success', 'warning'
  • string size: 'sm', 'lg'
  • bool block
public render(\Laminas\Form\ElementInterface $element, ?string $buttonContent = null): string

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface
$buttonContent?string

See Also:

  • \Laminas\Form\View\Helper\FormButton::render()

prepareElementAttributes

protected prepareElementAttributes(\Laminas\Form\ElementInterface $element): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

prepareElementClassAttributes

protected prepareElementClassAttributes(\Laminas\Form\ElementInterface $element): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

prepareElementAttributesForClose

protected prepareElementAttributesForClose(\Laminas\Form\ElementInterface $element): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

prepareElementAttributesForToggle

protected prepareElementAttributesForToggle(\Laminas\Form\ElementInterface $element): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

prepareElementAttributesForPopover

protected prepareElementAttributesForPopover(\Laminas\Form\ElementInterface $element): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

getElementPopoverAttributes

protected getElementPopoverAttributes(\Laminas\Form\ElementInterface $element): ?\TwbsHelper\View\HtmlAttributesSet

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

prepareElementAttributesForTooltip

protected prepareElementAttributesForTooltip(\Laminas\Form\ElementInterface $element): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

getElementTooltipAttributes

protected getElementTooltipAttributes(\Laminas\Form\ElementInterface $element): ?\TwbsHelper\View\HtmlAttributesSet

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

prepareElementAttributesForTag

protected prepareElementAttributesForTag(\Laminas\Form\ElementInterface $element): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

prepareElementValidTagAttributes

protected prepareElementValidTagAttributes(\Laminas\Form\ElementInterface $element): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

renderButtonContent

protected renderButtonContent(\Laminas\Form\ElementInterface $element, ?string $buttonContent = null): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface
$buttonContent?string

renderIconContent

protected renderIconContent(\Laminas\Form\ElementInterface $element, ?string $buttonContent = null): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface
$buttonContent?string

renderSpinnerContent

protected renderSpinnerContent(\Laminas\Form\ElementInterface $element, ?string $buttonContent = null): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface
$buttonContent?string

renderBadgeContent

protected renderBadgeContent(\Laminas\Form\ElementInterface $element, ?string $buttonContent = null): mixed

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface
$buttonContent?string

renderButton

protected renderButton(\Laminas\Form\ElementInterface $element, ?string $buttonContent = null): string

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface
$buttonContent?string

renderPopoverAndTooltip

protected renderPopoverAndTooltip(\Laminas\Form\ElementInterface $element, ?string $buttonContent = null): string

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface
$buttonContent?string

getType

Determine button type to use

protected getType(\Laminas\Form\ElementInterface $element): string

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface

Inherited methods

prepareAttributes

protected prepareAttributes(array $attributes): array

Parameters:

ParameterTypeDescription
$attributesarray

setClassesToElement

protected setClassesToElement(\Laminas\Form\ElementInterface $element, iterable $addClasses = [], iterable $removeClasses = []): \Laminas\Form\ElementInterface

Parameters:

ParameterTypeDescription
$element\Laminas\Form\ElementInterface
$addClassesiterable
$removeClassesiterable