Magento get controller name module name action name and route name

You can find the Magento Controller Name, Route Name, Module Name, and Action Name in any where in Magento . You just simple paste the below code and refresh the browser and see the Magento Controller NameRoute NameModule Name, and Action Name in your browser screen.


// Getting the Module Name in Magento
<?php echo  Mage::app()->getRequest()->getModuleName(); ?>


// Getting the Controller Name in Magento
<?php echo  Mage::app()->getRequest()->getControllerName(); ?>

// Getting the Action Name in Magento
<?php echo  Mage::app()->getRequest()->getActionName(); ?>


// Getting the Route Name in Magento
<?php echo  Mage::app()->getRequest()->getRouteName(); ?>


1 comment: