boolSelect
extends select
in
Bool select menu view helper object
Table of Contents
$options | Select options | array |
---|---|---|
$firstOption | Is first option auto added | int |
$hasOptGroup | Select includes opt groups | bool |
$prependLabel | Prepend label to selectbox | bool |
$returnString | Option return string | string |
$icon | Icon class | string |
$iconOnly | Show icon only | bool |
$iconStack | Button text | string |
$stackTop | Move stack icon to top | bool |
$size | Button text | string |
$spinner | Spinner class for icon | string |
$value | Element value | string |
$selected | Element value | string|array |
$isMultiple | Select multiple options | bool |
$labelSize | Label size string | string |
$fieldSize | Input field size | string |
$sizeMap | Size map | array |
$data | Element data | array |
$id | Element ID | string |
$name | Element name | string |
$text | Input label | string |
$class | CSS class string | string |
$readonly | Element is readonly | bool |
$autoFocused | Element is autoFocused | bool |
$prefix | Element prefix | string |
$useWrapper | Add div wrapper to input field | string |
$wrapperClass | CSS class for div wrapper | string |
$labelClass | CS class for label | string |
$language | Language object | language |
$returned | Flag if element string was return by @see __toString | bool |
init() | Optional init function | void |
getString() | Return element string | string |
init() | Optional init function | void |
setOptions() | Set options for selectbox | $this |
setFirstOption() | Select auto-added first option, values are fpcm\view\helper\select::FIRST_OPTION_EMPTY, fpcm\view\helper\select::FIRST_OPTION_PLEASESELECT, fpcm\view\helper\select::FIRST_OPTION_DISABLED | $this |
setOptGroup() | Enables opt group for select element | $this |
setWidth() | Set with of select menu | $this |
prependLabel() | Prepend label to select menu | $this |
getFirstOption() | Return first option string | bool |
getOptionsString() | Create options string | string|void |
getOptionsGroupsString() | Create options string | string |
setIcon() | Set icon | $this |
setIconOnly() | Set button to display icon only | $this |
setStack() | Set if icon is stacked | $this |
setSize() | Set Icon size | $this |
setStackTop() | Move stack icon to top | $this |
setSpinner() | Set flag icon has spinner | $this |
getIconString() | Return full icon string | string |
setValue() | Set input value | $this |
getValueString() | Return value string | string |
setSelected() | Set preselected value | $this |
setIsMultiple() | Enable multiple selection | $this |
getSelectedString() | Return selected string | string |
getLabelSize() | Fetch label size classes | string |
getFieldSize() | Fetch field size classes | string |
setDisplaySizesDefault() | Sets default label and field sizes values, Label: xs: 12, sm: 6, md: 5 Fields: xs: 12, sm: 6, md: 7 | $this |
setDisplaySizes() | Sets label and field sizes | $this |
setLabelSize() | Sets label sizes only | $this |
setFieldSize() | Sets field sizes only | $this |
mapSizes() | Maps indices to sizeMap | bool |
__construct() | Konstruktor | mixed |
setReturned() | Prevents rendering of view helper at the end of PHP proessing | $this |
getCleanName() | Name cleanup from bracket, etc. | string |
getNameIdString() | Returns name and ID string | string |
getIdString() | Returns name and ID string | string |
getDescriptionTextString() | Returns name and ID string | string |
initLabel() | Initialized default label by field name | bool |
setClass() | Set additional css class | $this |
getClassString() | Return class string | string |
getDataString() | Return class string | string |
getReadonlyString() | Return class string | string |
setReadonly() | Set element to readonly | $this |
setAutoFocused() | Make helper auto focused | $this |
getAutoFocusedString() | Return autofocused string | string |
setWrapper() | Use div wrapper around input field | $this |
setWrapperClass() | Set wrapper css class | $this |
setLabelClass() | Set label class CSS string | $this |
setText() | Set button description | $this |
getJsVars() | Returns optional JavaScript vars | void |
getJsLangVars() | Returns optional JavaScript language vars | void |
setData() | Add array for 'data-'-params to element | $this |
initFromYml() | bool |
Properties
$options
Select options
protected
array
$options
= []
$firstOption
Is first option auto added
protected
int
$firstOption
$hasOptGroup
Select includes opt groups
protected
bool
$hasOptGroup
= false
$prependLabel
Prepend label to selectbox
protected
bool
$prependLabel
= false
$returnString
Option return string
protected
string
$returnString
= []
$icon
Icon class
protected
string
$icon
= ''
$iconOnly
Show icon only
protected
bool
$iconOnly
= false
$iconStack
Button text
protected
string
$iconStack
= ''
$stackTop
Move stack icon to top
protected
bool
$stackTop
= false
$size
Button text
protected
string
$size
= ''
$spinner
Spinner class for icon
protected
string
$spinner
= ''
$value
Element value
protected
string
$value
= ''
$selected
Element value
protected
string|array
$selected
= ''
$isMultiple
Select multiple options
protected
bool
$isMultiple
= false
$labelSize
Label size string
protected
string
$labelSize
= ''
$fieldSize
Input field size
protected
string
$fieldSize
= ''
$sizeMap
Size map
private
array
$sizeMap
= [0 => 'col-', 1 => 'col-sm-', 2 => 'col-md-', 3 => 'col-lg-', 4 => 'col-xl-', 'xs' => 'col-', 'sm' => 'col-sm-', 'md' => 'col-md-', 'lg' => 'col-lg-', 'xl' => 'col-xl-']
$data
Element data
protected
array
$data
= []
$id
Element ID
protected
string
$id
= ''
$name
Element name
protected
string
$name
= ''
$text
Input label
protected
string
$text
= ''
$class
CSS class string
protected
string
$class
= ''
$readonly
Element is readonly
protected
bool
$readonly
= false
$autoFocused
Element is autoFocused
protected
bool
$autoFocused
= false
$prefix
Element prefix
protected
string
$prefix
= ''
$useWrapper
Add div wrapper to input field
protected
string
$useWrapper
= false
$wrapperClass
CSS class for div wrapper
protected
string
$wrapperClass
= ''
$labelClass
CS class for label
protected
string
$labelClass
= ''
$language
Language object
protected
language
$language
$returned
Flag if element string was return by @see __toString
protected
bool
$returned
= false
Methods
init()
Optional init function
protected
init(
)
: void
getString()
Return element string
protected
abstract getString(
)
: string
Return values
stringinit()
Optional init function
protected
init(
)
: void
setOptions()
Set options for selectbox
public
setOptions(
$options :
array
)
: $this
Parameters
- $options : array
Return values
$thissetFirstOption()
Select auto-added first option, values are fpcm\view\helper\select::FIRST_OPTION_EMPTY, fpcm\view\helper\select::FIRST_OPTION_PLEASESELECT, fpcm\view\helper\select::FIRST_OPTION_DISABLED
public
setFirstOption(
$firstOption :
int
)
: $this
Parameters
- $firstOption : int
Return values
$thissetOptGroup()
Enables opt group for select element
public
setOptGroup(
$hasGroup :
bool
)
: $this
Parameters
- $hasGroup : bool
Return values
$thissetWidth()
Set with of select menu
public
setWidth(
$width :
int
)
: $this
Parameters
- $width : int
Return values
$thisprependLabel()
Prepend label to select menu
public
prependLabel(
)
: $this
Tags
Return values
$thisgetFirstOption()
Return first option string
protected
getFirstOption(
)
: bool
Return values
boolgetOptionsString()
Create options string
protected
getOptionsString(
$options :
array
)
: string|void
Parameters
- $options : array
Return values
string|voidgetOptionsGroupsString()
Create options string
protected
getOptionsGroupsString(
)
: string
Return values
stringsetIcon()
Set icon
public
setIcon(
$icon :
string
[, $prefix :
string
= 'fa' ]
[, $useFa :
bool
= true ]
)
: $this
Parameters
- $icon : string
Icon CSS classes
- $prefix : string = 'fa'
Icon prefix
- $useFa : bool = true
Auto-add FontAwesome Icon classes
Return values
$thissetIconOnly()
Set button to display icon only
public
setIconOnly(
$iconOnly :
string
)
: $this
Parameters
- $iconOnly : string
Return values
$thissetStack()
Set if icon is stacked
public
setStack(
$iconStack :
string
[, $useFa :
bool
= true ]
)
: $this
Parameters
- $iconStack : string
- $useFa : bool = true
Auto-add FontAwesome Icon classes
Return values
$thissetSize()
Set Icon size
public
setSize(
$size :
string
[, $useFa :
bool
= true ]
)
: $this
Parameters
- $size : string
- $useFa : bool = true
Auto-add FontAwesome Icon classes
Return values
$thissetStackTop()
Move stack icon to top
public
setStackTop(
$stackTop :
bool
)
: $this
Parameters
- $stackTop : bool
Return values
$thissetSpinner()
Set flag icon has spinner
public
setSpinner(
$spinner :
string
[, $useFa :
bool
= true ]
)
: $this
Parameters
- $spinner : string
- $useFa : bool = true
Return values
$thisgetIconString()
Return full icon string
protected
getIconString(
)
: string
Return values
stringsetValue()
Set input value
public
setValue(
$value :
mixed
[, $escapeMode :
int
= null ]
)
: $this
Parameters
- $value : mixed
- $escapeMode : int = null
Return values
$thisgetValueString()
Return value string
protected
getValueString(
)
: string
Return values
stringsetSelected()
Set preselected value
public
setSelected(
$selected :
string|int|array
)
: $this
Parameters
- $selected : string|int|array
Return values
$thissetIsMultiple()
Enable multiple selection
public
setIsMultiple(
$isMultiple :
bool
)
: $this
Parameters
- $isMultiple : bool
Return values
$thisgetSelectedString()
Return selected string
protected
getSelectedString(
)
: string
Return values
stringgetLabelSize()
Fetch label size classes
public
getLabelSize(
)
: string
Return values
stringgetFieldSize()
Fetch field size classes
public
getFieldSize(
)
: string
Return values
stringsetDisplaySizesDefault()
Sets default label and field sizes values, Label: xs: 12, sm: 6, md: 5 Fields: xs: 12, sm: 6, md: 7
public
setDisplaySizesDefault(
)
: $this
Return values
$thissetDisplaySizes()
Sets label and field sizes
public
setDisplaySizes(
$label :
array
, $field :
array
)
: $this
Parameters
- $label : array
- $field : array
Return values
$thissetLabelSize()
Sets label sizes only
public
setLabelSize(
$labelSizes :
array
)
: $this
Parameters
- $labelSizes : array
Return values
$thissetFieldSize()
Sets field sizes only
public
setFieldSize(
$fieldSizes :
array
)
: $this
Parameters
- $fieldSizes : array
Return values
$thismapSizes()
Maps indices to sizeMap
private
mapSizes(
&$size :
string|int
, $index :
string|int
)
: bool
Parameters
- $size : string|int
- $index : string|int
Return values
bool__construct()
Konstruktor
public
__construct(
$name :
string
[, $id :
string
= '' ]
)
: mixed
Parameters
- $name : string
- $id : string = ''
Return values
mixedsetReturned()
Prevents rendering of view helper at the end of PHP proessing
public
setReturned(
$returned :
bool
)
: $this
Parameters
- $returned : bool
Return values
$thisgetCleanName()
Name cleanup from bracket, etc.
protected
final getCleanName(
)
: string
Return values
stringgetNameIdString()
Returns name and ID string
protected
getNameIdString(
)
: string
Return values
stringgetIdString()
Returns name and ID string
public
final getIdString(
)
: string
Return values
stringgetDescriptionTextString()
Returns name and ID string
protected
final getDescriptionTextString(
)
: string
Return values
stringinitLabel()
Initialized default label by field name
protected
final initLabel(
)
: bool
Tags
Return values
boolsetClass()
Set additional css class
public
setClass(
$class :
string
)
: $this
Parameters
- $class : string
Return values
$thisgetClassString()
Return class string
protected
getClassString(
)
: string
Return values
stringgetDataString()
Return class string
protected
getDataString(
)
: string
Return values
stringgetReadonlyString()
Return class string
protected
getReadonlyString(
)
: string
Return values
stringsetReadonly()
Set element to readonly
public
setReadonly(
$readonly :
bool
)
: $this
Parameters
- $readonly : bool
Return values
$thissetAutoFocused()
Make helper auto focused
public
setAutoFocused(
$autoFocused :
bool
)
: $this
Parameters
- $autoFocused : bool
Tags
Return values
$thisgetAutoFocusedString()
Return autofocused string
protected
getAutoFocusedString(
)
: string
Return values
stringsetWrapper()
Use div wrapper around input field
public
setWrapper(
$useWrapper :
bool
)
: $this
Parameters
- $useWrapper : bool
Return values
$thissetWrapperClass()
Set wrapper css class
public
setWrapperClass(
$wrapperClass :
string
)
: $this
Parameters
- $wrapperClass : string
Return values
$thissetLabelClass()
Set label class CSS string
public
setLabelClass(
$labelClass :
string
)
: $this
Parameters
- $labelClass : string
Tags
Return values
$thissetText()
Set button description
public
final setText(
$text :
string
[, $params :
array
= [] ]
)
: $this
Parameters
- $text : string
- $params : array = []
Return values
$thisgetJsVars()
Returns optional JavaScript vars
public
getJsVars(
)
: void
getJsLangVars()
Returns optional JavaScript language vars
public
getJsLangVars(
)
: void
setData()
Add array for 'data-'-params to element
public
setData(
$data :
array
)
: $this
Parameters
- $data : array
Return values
$thisinitFromYml()
public
final initFromYml(
$param :
array
, $viewVars :
array
)
: bool
Parameters
- $param : array
- $viewVars : array