1

what is the use of in system.xml. In my module its getting error

Invalid XML in file /var/www/html/Magento2/app/code/A/A/etc/adminhtml/system.xml:
Element 'class': This element is not expected.

my code is

<system>
     <tab id="A" translate="label" sortOrder="50">
         <label>A</label>
         <class>A</class>
     </tab>

3 Answers 3

2

You are not allowed to use class tag inside the tab elements in system.xml.

Make your tab definition like this

<tab id="A" translate="label" sortOrder="50">
    <label>A</label>
</tab>

You can only use class inside section tags like this

1
  • You can refer ../vendor/magento/module-config/etc/system_file.xsd for rules. Commented Jan 3, 2017 at 13:36
0

System.xml is used to create System configuration for our module.

If you don't need any system configuration from backend you can remove system.xml from your code.

But if you want to set system configuration you need to follow rules as

<tab id="<id_module>" translate="label" sortOrder="1">
      <label>Label for Main Tab</label>
</tab>

You need no to give any class to tab.

0

You should use this approach to add your class:

<tab id="A" translate="label" class="A" sortOrder="50">
    <label>A</label>
</tab>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.