Magento 2 Add a note under a form field using ui components
- In php code:
$fieldset->addField(
'url',
'text',
[
'name' => 'url',
'label' => __('URL'),
'title' => __('URL'),
'required' => false,
'note' => 'Can be an absolute or relative path.'
]
);
- In Ui Form:
<item name="notice" xsi:type="string" translate="true">
example:
<field name="sku">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="label" xsi:type="string" translate="true">Sku</item>
<item name="visible" xsi:type="boolean">true</item>
<item name="dataType" xsi:type="string">text</item>
<item name="formElement" xsi:type="string">input</item>
<item name="source" xsi:type="string">product_information</item>
<item name="dataScope" xsi:type="string">sku</item>
<item name="disabled" xsi:type="boolean">true</item>
<item name="notice" xsi:type="string" translate="true">Auto Created</item>
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">true</item>
</item>
</item>
</argument>
</field>
Tony's blog image
More Magento 2 Document, Please View https://www.abmbio.xin/category/6
网友评论