Creating your own XML module configuration file
In Magento 1.x, it was possible to use the .xml
file to include custom configuration options that might be necessary for an extension. This is no longer possible with Magento 2 because the XML files are all validated against a schema and anything other than predefined options are not allowed. To solve this, it is possible to generate your own custom XML file to set up the parameters that you need. This also allows other extensions to define settings as the output is generated from all modules that have this file configured.
Getting ready
In order to use your own XML configuration file, it is important that you generate a valid schema (XSD) file that will be used to validate the XML files when they are merged.
How to do it…
The following steps show you how to define a custom XML configuration file for your module:
First, we create the
Reader
for the XML file and define the name of the file that should be read from all modules:Model/Sample/Reader...