Magento 2 certification: configuration files [visibility areas]

Table of Content

config-files-tree-magento-2-certification
Posted in: Our News
0 comments

Hello to Amasty blog readers!

We hope your preparation for Magento 2 certification goes well.

Good news, by the way, another of our team developers Mihail has prepared the answer to the 1.3 topic from the study guide. So, enjoy studying.


Magento 2 configuration files [brief overview]

Magento 2 configuration is divided into separate configuration files. Each of the files (that are also called configuration types) is responsible for its own task and located in the relevant directory.

The configuration files allow you to easily customize a component and are loaded only when Magento accesses the configuration directly.

Read here to learn more about configuration files loading.

Thus, to change the behavior of your module you need to know how to utilize the configuration files.

Visibility areas

Magento 2 has several visibility areas:

  1. Primary configuration (app/etc/di.xml)
  2. Global configurations from modules (<your component base dir>/<vendorname>/<component-type>-<component-name>/etc/*.xml)
  3. Area-specific configuration from modules (<your component base dir>/<vendorname>/<component-type>-<component-name>/etc/<area>/*.xml)

In this, number (1) directory is used for bootstrapping Magento; number (2) directory is responsible for collecting and merging certain configuration files from all modules; and number (3) directory gathers and merges configuration files from all modules into the global configuration.

Where:

  • <your component base dir> is the base directory in which your component is located;
  • <vendorname> is the component developer (vendor) name;
  • <component-type> is:
    module-
    theme-
    language-
  • <area> is:
    frontend (for store frontend)
    adminhtml (for store backend)
    webapi_rest (REST API)
    webapi_soap (SOAP API)

Configuration files and their utilization

Here is the tree of configuration files:

Below we will take a look at each of the files and their intended use.

config.xml

This configuration file contains default values for configuration:

module.xml

The configuration file stores the name and version of the module, as well as its dependencies on other modules:

acl.xml

The configuration file can be used for admin users access setting up by utilizing roles:

di.xml

The file can be utilized for dependencies injection. It is required for creating plugins and virtual types, as well as for declaring dependencies between classes.

Learn more from here:

email_templates.xml

The configuration file contains email templates:

events.xml

The file contains reactions of the observers to the events they are set to watch for:

webapi.xml

The file stores API configuration:

sections.xml

The file is utilized to define actions which trigger update section:

routes.xml

The configuration file is utilized for routing setup:

system.xml

The file can be used for creating settings in Stores>Configuration:

The configuration file is utilized for adding tabs to the Admin Panel:

crontab.xml

The file is used for creating cron tasks:

view.xml

The configuration file stores dynamic information about themes. E.g.: information about the sizes of product images:

That's all for today. The short notes have been gathered to put you in the way of things. If you need to dig a little deeper, consult the official Magento DevDocs.

We hope this was of service. Share your opinion and drop us a line if you still have questions on the topic.

P.S. Stay tuned and check our next posts in preparation for Magento 2 certification exam!


April 22, 2018
May 1, 2018
April 17, 2018
Comments
Leave your comment

Your email address will not be published

This blog was created with Amasty Blog Pro

This blog was created with Amasty Blog Pro