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>
28
Author: Alex Gusev, 2017-01-22
2 answers
Конфигурация системы Magento 2 предоставляет поля следующего типа.
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
53
Author: Amit Bera, 2017-10-02 09:39:43
Просмотр файла /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
, как указано в комментарии Мохита ниже.
16
Author: RNanoware, 2020-08-06 06:30:53