3

I don't have knowledge in Magento 1. I have started to learn Magento 2, I want to know which file runs first when I go to: http://localhost/magento/mymodule

1 Answer 1

4

Quick answer, the first file is: index.php

Below some links and explanations...

Routing processing

Routing is processed in the following way:

  • Modules provide information on their routers through the routerList parameter of Magento\Framework\App\RouterList type in di.xml.
  • FrontController obtains active routers and checks whether a request can be processed.
  • If a request cannot be processed by any router, the default router is used.
  • If a request can be processed by a router, the router finds a route with matching frontName and looks through corresponding modules. If a module has matching controller and action names, a router instantiates this controller.

The dispatch() method of the Magento\Framework\App\Action\Action class requests an instance and returns its response.

For this class, the Magento\Framework\App\ActionInterface processes the requests through its actions. Also, the following classes participate in processing the requests:

Default router

If a request cannot be processed by any router, the Magento\App\Framework\Router\DefaultRouter default router lists handlers for processing such request.

Magento\App\Router\NoRouteHandlerList contains the list of handlers.

Related informations

0

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.