Areas and application entry points

Each module can have a global and area-specific di.xml file. The application reads all the di.xml configuration files declared in the system and merges them all together by appending all nodes.

As a general rule, the area specific di.xml files should configure dependencies for the presentation layer, and your module's global di.xml file should configure the remaining dependencies.

The application loads the configuration in the following stages:

  1. Initial (app/etc/di.xml)
  2. Global (<moduleDir>/etc/di.xml)
  3. Area-specific (<moduleDir>/etc/<area>/di.xml)

The areas are:

  • adminhtml
  • frontend
  • graphql
  • webapi_rest
  • webapi_soap
  • crontab

During bootstrapping, each application entry point loads the appropriate di.xml files for the requested area.

 

Constructor arguments