A Complete Tutorial On Magento 2 Routing

in #magento4 years ago (edited)

Routing in Magento 2 defines the flow of request and the router classes that matches and processes the requests.

A-Complete-Tutorial-On-Magento-2-Routing-Social-Share.png

For examples, the router_name in request with the following endpoint in Magento 2 - /index.php/router_name/controller/action is used to find the module. The request follows the controller/action: index.php → HTTP app → FrontController → Routing → Controller processing → etc path to find the required module.

In the HTTP class, the FrontController is called for routing the request and finding the controller/action match. You can also create a custom route on frontend and admin in Magento 2 by creating routes.xml file in the respective directory.

I have provided complete steps along with the code to create custom frontend and admin route in Magento 2. You can read the complete post athttps://meetanshi.com/blog/magento-2-routing/

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.092
BTC 63142.90
ETH 1787.16
USDT 1.00
SBD 0.39