Class CheckboxGroup
Responsibility: init, pre-dispatch and render group of input
s with type
as checkbox
, with configuration to select minimum and maximum count of values and required option. CheckboxGroup
has it's own validator to check if submitted values are presented in configured by default and it's own validator to check minimum or maximum count of selected options.
- MvcCore\Ext\Forms\Field implements MvcCore\Ext\Forms\IField uses MvcCore\Ext\Forms\Field\Props, MvcCore\Ext\Forms\Field\Getters, MvcCore\Ext\Forms\Field\Setters, MvcCore\Ext\Forms\Field\Rendering
-
MvcCore\Ext\Forms\FieldsGroup implements MvcCore\Ext\Forms\Fields\IVisibleField, MvcCore\Ext\Forms\Fields\ILabel, MvcCore\Ext\Forms\Fields\IOptions, MvcCore\Ext\Forms\Fields\IMultiple, MvcCore\Ext\Forms\IFieldsGroup uses MvcCore\Ext\Forms\Field\Props\VisibleField, MvcCore\Ext\Forms\Field\Props\Label, MvcCore\Ext\Forms\Field\Props\Options, MvcCore\Ext\Forms\Field\Props\GroupLabelCssClasses, MvcCore\Ext\Forms\Field\Props\GroupLabelAttrs
-
MvcCore\Ext\Forms\Fields\CheckboxGroup implements MvcCore\Ext\Forms\Fields\IMinMaxOptions uses MvcCore\Ext\Forms\Field\Props\MinMaxOptions
Located at ext-form-field-selection/src/MvcCore/Ext/Forms/Fields/CheckboxGroup.php
public
|
|
public
|
#
SetForm(
This INTERNAL method is called from |
public
array
&
|
#
GetValidatorData( array $fieldPropsDefaultValidValues = [] )
Return field specific data for validator. |
public
|
#
PreDispatch( )
This INTERNAL method is called from |
protected
array
|
#
renderControlItemCompleteAttrsClassesAndText( string $key, string|array & $option )
Complete and return semi-finished strings for rendering by field key and option: - Label text string. - Label attributes string. - Control attributes string. |
AddValidationError(),
Submit(),
__call(),
__get(),
__set(),
throwNewInvalidArgumentException(),
translateAndFormatValidationError()
|
AddGroupLabelAttr(),
AddGroupLabelCssClasses(),
GetGroupLabelAttrs(),
GetGroupLabelCssClasses(),
SetGroupLabelAttrs(),
SetGroupLabelCssClasses()
|
AddOptions(),
GetFlattenOptions(),
GetOptions(),
GetTranslateOptions(),
SetOptions(),
SetTranslateOptions()
|
AddOptions(),
GetFlattenOptions(),
GetOptions(),
GetTranslateOptions(),
SetOptions(),
SetTranslateOptions()
|
AddGroupLabelCssClasses(),
GetGroupLabelCssClasses(),
SetGroupLabelCssClasses()
|
AddGroupLabelAttr(),
GetGroupLabelAttrs(),
SetGroupLabelAttrs()
|
integer |
ERROR_REQUIRED_BUBBLE
Valid email address error message index. |
#
0
|
integer |
ERROR_MIN_OPTIONS_BUBBLE
|
#
1
|
integer |
ERROR_MAX_OPTIONS_BUBBLE
|
#
2
|
AUTOFOCUS_DUPLICITY_EXCEPTION,
AUTOFOCUS_DUPLICITY_QUIETLY_SET_NEW,
AUTOFOCUS_DUPLICITY_UNSET_OLD_SET_NEW,
LABEL_SIDE_LEFT,
LABEL_SIDE_RIGHT
|
protected static
array
|
$errorMessages
Validation failure message template definitions. |
#
[
self::ERROR_REQUIRED_BUBBLE => "Please tick this box, field is required.",
self::ERROR_MIN_OPTIONS_BUBBLE => "Please select at least `{1}` option(s) as minimum.",
self::ERROR_MAX_OPTIONS_BUBBLE => "Please select up to `{1}` option(s) at maximum.",
]
|
protected
string
|
$type
Possible value: |
#
'checkbox-group'
|
protected
string[]|Closure[]
|
$validators
Validators:
- |
#
["ValueInOptions"]
|
protected
string
|
$jsClassName
Supporting javascript full javascript class name.
If you want to use any custom supporting javascript prototyped class
for any additional purposes for your custom field, you need to use
|
#
'MvcCoreForm.CheckboxGroup'
|
protected
string
|
$jsSupportingFile
Field supporting javascript file relative path.
If you want to use any custom supporting javascript file (with prototyped
class) for any additional purposes for your custom field, you need to
define path to your javascript file relatively from configured
|
#
\MvcCore\Ext\IForm::FORM_ASSETS_DIR_REPLACEMENT . '/fields/checkbox-group.js'
|
protected
string
|
$maxOptionsClassName
Maximum options specific css class for supporting javascript code. |
#
'max-selected-options'
|
protected static
string
|
$templates
Standard field template strings for natural rendering a |
#
[
'control' => '<input id="{id}" name="{name}[]" type="checkbox" value="{value}"{checked}{attrs} />',
]
|
$value
|
$controlAttrs,
$cssClasses,
$cssSupportingFile,
$declaredProtectedProperties,
$errors,
$form,
$id,
$name,
$title,
$translate,
$translateTitle,
$value,
$view,
$viewScript
|
$label,
$labelAttrs,
$labelSide,
$renderMode,
$translateLabel
|
$flattenOptions,
$options,
$translateOptions
|
$groupLabelCssClasses
|
$groupLabelAttrs
|
$maxOptions,
$maxOptionsBubbleMessage,
$minOptions,
$minOptionsBubbleMessage,
$requiredBubbleMessage
|