美文网首页
Magento 2 Add a note under a for

Magento 2 Add a note under a for

作者: 葡萄月令 | 来源:发表于2018-05-20 13:49 被阅读6次

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

More Information, Please Subscribe My Wechat Public Platform Or View My Blog : https://www.abmbio.xin

20180117_81914.jpg

相关文章

网友评论

      本文标题:Magento 2 Add a note under a for

      本文链接:https://www.haomeiwen.com/subject/ngftjftx.html