Magento get current controller ,current module , current action and route name
Magento get current controller ,current module , current action and route name :
Sometimes we need to get current Controller, Module , action & route name in magento :
its very easy to get the current name :
1 . controller name
Mage::app()->getRequest()->getControllerName();
// will return controller name
2. action name
Mage::app()->getRequest()->getActionName();
//will return action name
2. module name
Mage::app()->getRequest()->getModuleName();
// will return module name
2. routes name
Mage::app()->getRequest()->getRouteName();
//will return routes name
Advertisements
Add Comment
📖 Read More
- 1. Magento Custom Collection Sorting | Magento sort collection Item
- 2. can't retrieve entity config magento
- 3. Magento get current customer id
- 4. Magento get current date time
- 5. Fatal error: Call to a member function setSaveParametersInSession() on a non-object in \mage\app\code\core\Mage\Adminhtml\Block\Widget\Grid\Container.php on line 66