Input Params - Alekseon/magento2-widget-forms GitHub Wiki

Its easy to add additional parameters for fields by di.xml file. Values of this parameters can be used in field templates for customization, validation, etc.

Usage in field template:

$block->getField()->getInputParam('my_input_param');

Read about template overrides here: https://github.com/Alekseon/magento2-widget-forms/wiki/Template-overrides

Input Params can be defined for:

  • Input Type
  • Input Validators
  • Default Value Providers

Input Type Params

Example Input Type definition for text input type:

<type name="Alekseon\AlekseonEav\Model\Attribute\InputTypeRepository">
    <arguments>
        <argument name="frontendInputTypes" xsi:type="array">
            <item name="text" xsi:type="array">
                <item name="input_params" xsi:type="array">
                    <item name="my_input_param" xsi:type="array">
                        <item name="label" xsi:type="string">My Input Type</item>
                    </item>
                </item>
            </item>
        </argument>
    </arguments>
</type>

Validators Params

Input parameters can be defined for validators. These parameters are displayed in the field settings only if the appropriate validator is selected for field.

For example we use input param "Max Length" for Max Length validator.

Default Value Providers Params

Input parameters can be defined for default value providers. These parameters are displayed in the field settings only if the appropriate default value provider is selected for field.

For example we use input param "Default Value" for "Default Text" value provider.

⚠️ **GitHub.com Fallback** ⚠️