Magento 2 – Get Controller name, Module name, Action name and Router name / Learn Magento 2 Adobe Commerce / By Saphal PHPprotected $request; public function __construct( ... \Magento\Framework\App\Request\Http $request ... ){ ... $this->request = $request; ... } PHPpublic function YourFunction(){ echo "Module Name = " . $this->request->getModuleName(); echo "Controller Name = " . $this->request->getControllerName(); echo "Action Name = " . $this->request->getActionName(); echo "Route Name = " . $this->request->getRouteName(); }