Documentation

openButton extends linkButton
in package

Edit link button view helper object

Tags
author

Stefan Seehafer sea75300@yahoo.de

copyright

(c) 2011-2022, Stefan Seehafer

license

http://www.gnu.org/licenses/gpl.txt GPLv3

Table of Contents

ID_START_PREFIX  = 'fpcm-id-'
LABEL_TYPE_DEFAULT  = 'input-group'
LABEL_TYPE_FLOATING  = 'form-floating'
NAME_PREFIX  = 'btn'
TARGET_NEW  = '_blank'
TEXT_DEFAULT_LABEL  = 'LABEL_FIELD_'
$aria  : array<string|int, mixed>
Ement aria config
$autoFocused  : bool
Element is autoFocused
$bottomSpace  : string
UI element bottom spance
$class  : string
CSS class string
$data  : array<string|int, mixed>
Element data
$icon  : string
Icon class
$iconOnly  : bool
Show icon only
$iconStack  : string
Icon stack class
$id  : string
Element ID
$labelClass  : string
CS class for label
$labelType  : string
Column with if input uses an icon
$language  : language
Language object
$name  : string
Element name
$prefix  : string
Element prefix
$primary  : bool
Is primary button
$readonly  : bool
Element is readonly
$rel  : string
rel-Attribute
$requ  : bool
Element is required
$returned  : bool
Flag if element string was return by @see __toString
$size  : string
Icon size
$spinner  : string
Spinner class for icon
$stackTop  : bool
Move stack icon to top
$target  : string
Link URL target
$text  : string
Input label
$type  : string
Element type
$url  : string
Link URL
$useWrapper  : string
Add div wrapper to input field
$wrapperClass  : string
CSS class for div wrapper
__construct()  : mixed
Konstruktor
getCleanName()  : string
Name cleanup from bracket, etc.
getIdString()  : string
Returns name and ID string
getJsLangVars()  : void
Returns optional JavaScript language vars
getJsVars()  : void
Returns optional JavaScript vars
initFromYml()  : bool
overrideButtonType()  : $this
Override bs button type
setAria()  : $this
Add array for 'data-'-params to element
setAutoFocused()  : $this
Make helper auto focused
setBottomSpace()  : $this
Set bottom space class
setClass()  : $this
Set additional css class
setData()  : $this
Add array for 'data-'-params to element
setIcon()  : $this
Set icon
setIconOnly()  : $this
Set button to display icon only
setLabelClass()  : $this
Set label class CSS string
setLabelTypeFloat()  : $this
Set label typ to floating
setOnClick()  : $this
Bind function to button click
setPrimary()  : $this
Set button to primary
setReadonly()  : $this
Set element to readonly
setRel()  : $this
Set "rel" attribute value
setRequired()  : $this
Set required flag
setReturned()  : $this
Prevents rendering of view helper at the end of PHP proessing
setSize()  : $this
Set Icon size
setSpinner()  : $this
Set flag icon has spinner
setStack()  : $this
Set if icon is stacked
setStackTop()  : $this
Move stack icon to top
setTarget()  : $this
Set link target
setText()  : $this
Set button description
setType()  : $this
Set button type
setUrl()  : $this
Set link url
setUrlbyObject()  : $this
Set URL by given object
setWrapper()  : $this
Use div wrapper around input field
setWrapperClass()  : $this
Set wrapper css class
getAriaString()  : string
Return class string
getAutoFocusedString()  : string
Return autofocused string
getClassString()  : string
Return class string
getColorMode()  : string
Returns color mode
getDataString()  : string
Return class string
getDescriptionTextString()  : string
Returns name and ID string
getIconString()  : string
Return full icon string
getNameIdString()  : string
Returns name and ID string
getReadonlyString()  : string
Return class string
getRelString()  : string
Returns name and ID string
getString()  : string
Return element string
getTargetString()  : string
init()  : void
Optional init function
initLabel()  : bool
Initialized default label by field name
isFloating()  : bool
assocArrayToString()  : string
Turns assoc array into string

Constants

ID_START_PREFIX

public mixed ID_START_PREFIX = 'fpcm-id-'

LABEL_TYPE_DEFAULT

public mixed LABEL_TYPE_DEFAULT = 'input-group'

LABEL_TYPE_FLOATING

public mixed LABEL_TYPE_FLOATING = 'form-floating'

NAME_PREFIX

public mixed NAME_PREFIX = 'btn'

TEXT_DEFAULT_LABEL

public mixed TEXT_DEFAULT_LABEL = 'LABEL_FIELD_'

Properties

$aria

Ement aria config

protected array<string|int, mixed> $aria = []
Tags
since
5.0-dev

$autoFocused

Element is autoFocused

protected bool $autoFocused = false
Tags
since
4.1

$bottomSpace

UI element bottom spance

protected string $bottomSpace = 'mb-3'

$data

Element data

protected array<string|int, mixed> $data = []

$iconOnly

Show icon only

protected bool $iconOnly = false

$iconStack

Icon stack class

protected string $iconStack = ''

$id

Element ID

protected string $id = ''

$labelClass

CS class for label

protected string $labelClass = ''
Tags
since
4.1

$labelType

Column with if input uses an icon

protected string $labelType = 'input-group'

$name

Element name

protected string $name = ''

$prefix

Element prefix

protected string $prefix = ''

$primary

Is primary button

protected bool $primary = false
Tags
since
5.0-dev

$readonly

Element is readonly

protected bool $readonly = false

$rel

rel-Attribute

protected string $rel = ''
Tags
since
4.1

$requ

Element is required

protected bool $requ = false
Tags
since
5.0.0-a3

$returned

Flag if element string was return by @see __toString

protected bool $returned = false

$spinner

Spinner class for icon

protected string $spinner = ''
Tags
since
4.2

$stackTop

Move stack icon to top

protected bool $stackTop = false

$target

Link URL target

protected string $target = ''

$text

Input label

protected string $text = ''

$useWrapper

Add div wrapper to input field

protected string $useWrapper = false

$wrapperClass

CSS class for div wrapper

protected string $wrapperClass = ''

Methods

__construct()

Konstruktor

public __construct(string $name[, string $id = '' ]) : mixed
Parameters
$name : string
$id : string = ''
Return values
mixed

getCleanName()

Name cleanup from bracket, etc.

public final getCleanName() : string
Return values
string

getIdString()

Returns name and ID string

public final getIdString() : string
Return values
string

getJsLangVars()

Returns optional JavaScript language vars

public getJsLangVars() : void
Return values
void

getJsVars()

Returns optional JavaScript vars

public getJsVars() : void
Return values
void

initFromYml()

public final initFromYml(array<string|int, mixed> $param, array<string|int, mixed> $viewVars) : bool
Parameters
$param : array<string|int, mixed>
$viewVars : array<string|int, mixed>
Tags
since
4.5
Return values
bool

overrideButtonType()

Override bs button type

public overrideButtonType(string $type) : $this
Parameters
$type : string
Tags
since
5.0.0-b3
Return values
$this

setAria()

Add array for 'data-'-params to element

public setAria(array<string|int, mixed> $aria) : $this
Parameters
$aria : array<string|int, mixed>
Return values
$this

setAutoFocused()

Make helper auto focused

public setAutoFocused(bool $autoFocused) : $this
Parameters
$autoFocused : bool
Tags
since
4.1
Return values
$this

setBottomSpace()

Set bottom space class

public setBottomSpace(string $bottomSpace) : $this
Parameters
$bottomSpace : string
Tags
since
5.1-dev
Return values
$this

setClass()

Set additional css class

public setClass(string $class) : $this
Parameters
$class : string
Return values
$this

setData()

Add array for 'data-'-params to element

public setData(array<string|int, mixed> $data) : $this
Parameters
$data : array<string|int, mixed>
Return values
$this

setIcon()

Set icon

public setIcon(string $icon[, string $prefix = 'fa' ][, bool $useFa = true ]) : $this
Parameters
$icon : string

Icon CSS classes

$prefix : string = 'fa'

Icon prefix

$useFa : bool = true

Auto-add FontAwesome Icon classes

Return values
$this

setIconOnly()

Set button to display icon only

public setIconOnly([string $iconOnly = true ]) : $this
Parameters
$iconOnly : string = true
Return values
$this

setLabelClass()

Set label class CSS string

public setLabelClass(string $labelClass) : $this
Parameters
$labelClass : string
Tags
since
4.1
Return values
$this

setLabelTypeFloat()

Set label typ to floating

public setLabelTypeFloat() : $this
Tags
since
5.0.0-b4
Return values
$this

setOnClick()

Bind function to button click

public final setOnClick(string $func[, type $args = null ]) : $this
Parameters
$func : string
$args : type = null
Tags
since
5.0-dev
Return values
$this

setPrimary()

Set button to primary

public setPrimary([bool $primary = true ]) : $this
Parameters
$primary : bool = true
Tags
since
5.0-dev
Return values
$this

setReadonly()

Set element to readonly

public setReadonly(bool $readonly) : $this
Parameters
$readonly : bool
Return values
$this

setRel()

Set "rel" attribute value

public setRel(string $rel) : $this
Parameters
$rel : string
Tags
since
4.1
Return values
$this

setRequired()

Set required flag

public setRequired([bool $requ = true ]) : $this
Parameters
$requ : bool = true
Tags
since
5.0.0-a3
Return values
$this

setReturned()

Prevents rendering of view helper at the end of PHP proessing

public setReturned(bool $returned) : $this
Parameters
$returned : bool
Return values
$this

setSize()

Set Icon size

public setSize(string $size[, bool $useFa = true ]) : $this
Parameters
$size : string
$useFa : bool = true

Auto-add FontAwesome Icon classes

Return values
$this

setSpinner()

Set flag icon has spinner

public setSpinner(string $spinner[, bool $useFa = true ]) : $this
Parameters
$spinner : string
$useFa : bool = true
Return values
$this

setStack()

Set if icon is stacked

public setStack(string $iconStack[, bool $useFa = true ]) : $this
Parameters
$iconStack : string
$useFa : bool = true

Auto-add FontAwesome Icon classes

Return values
$this

setStackTop()

Move stack icon to top

public setStackTop(bool $stackTop) : $this
Parameters
$stackTop : bool
Return values
$this

setTarget()

Set link target

public setTarget(string $target) : $this
Parameters
$target : string
Return values
$this

setText()

Set button description

public final setText(string $text[, array<string|int, mixed> $params = [] ][, bool $spf = false ]) : $this
Parameters
$text : string
$params : array<string|int, mixed> = []
$spf : bool = false
Return values
$this

setType()

Set button type

public setType(string $type) : $this
Parameters
$type : string
Return values
$this

setUrl()

Set link url

public setUrl(string $url) : $this
Parameters
$url : string
Return values
$this

setUrlbyObject()

Set URL by given object

public final setUrlbyObject(dataset $object[, string $paramsString = '' ]) : $this
Parameters
$object : dataset
$paramsString : string = ''
Return values
$this

setWrapper()

Use div wrapper around input field

public setWrapper(bool $useWrapper) : $this
Parameters
$useWrapper : bool
Return values
$this

setWrapperClass()

Set wrapper css class

public setWrapperClass(string $wrapperClass) : $this
Parameters
$wrapperClass : string
Return values
$this

getAriaString()

Return class string

protected getAriaString() : string
Return values
string

getAutoFocusedString()

Return autofocused string

protected getAutoFocusedString() : string
Return values
string

getClassString()

Return class string

protected getClassString() : string
Return values
string

getColorMode()

Returns color mode

protected getColorMode() : string
Tags
since
5.2.0-a1
Return values
string

getDataString()

Return class string

protected getDataString() : string
Return values
string

getDescriptionTextString()

Returns name and ID string

protected final getDescriptionTextString([string $prefix = 'ps-1' ]) : string
Parameters
$prefix : string = 'ps-1'
Return values
string

getIconString()

Return full icon string

protected getIconString() : string
Return values
string

getNameIdString()

Returns name and ID string

protected getNameIdString() : string
Return values
string

getReadonlyString()

Return class string

protected getReadonlyString() : string
Return values
string

getRelString()

Returns name and ID string

protected getRelString() : string
Tags
since
4.1
Return values
string

getString()

Return element string

protected abstract getString() : string
Return values
string

getTargetString()

protected getTargetString() : string
Tags
since
5.1.0-b4
Return values
string

init()

Optional init function

protected init() : void
Return values
void

initLabel()

Initialized default label by field name

protected final initLabel() : bool
Tags
since
4.3.0
Return values
bool

isFloating()

protected isFloating() : bool
Tags
since
5.1-dev
Return values
bool

assocArrayToString()

Turns assoc array into string

private assocArrayToString(string $prefix, array<string|int, mixed> $data) : string
Parameters
$prefix : string
$data : array<string|int, mixed>
Return values
string

Search results