Magento 2:system.xml中的可用字段类型

etc/system.xml配置文件中字段类型的可用值有什么:

<?xml version="1.0"?>
<config
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="...">
            <group id="...">
                <field id="..." type="???">
                    ...
                </field>
            </group>
        </section>
    </system>
</config>

从文件/lib/internal/Magento/Framework/Data/Form/Element/Factory.php(找到这里 Github上,对于Magento的2.2&2.3),人们可以找到的元素下面的默认列表:

// Factory.php, lines 26-55
protected $_standardTypes = [
    'button',
    'checkbox',
    'checkboxes',
    'column',
    'date',
    'editablemultiselect',
    'editor',
    'fieldset',
    'file',
    'gallery',
    'hidden',
    'image',
    'imagefile',
    'label',
    'link',
    'multiline',
    'multiselect',
    'note',
    'obscure',
    'password',
    'radio',
    'radios',
    'reset',
    'select',
    'submit',
    'text',
    'textarea',
    'time',
];

如果使用Composer安装Magento,也可以在中找到数据/vendor/magento/framework/Data/Form/Element/Factory.php

相关文章

0 0 投票数
文章评分
订阅评论
提醒
0 评论
内联反馈
查看所有评论