Magento Certified Developer GuideCategory: 6. AdminhtmlWhen does Magento figure out which area to use on the current page?
Manish Prakash Staff asked 5 years ago

So there are two primary routers, admin and standard. For an admin URL it matches the “admin” route and take it inside the “Mage_Adminhtml” module. This is done in admin router.
In this module every controller extends the class “Mage_Adminhtml_Controller_Action”. In the preDispatch() action, there is this code “$this->getLayout()->setArea($this->_currentArea);” and then “Mage::app()->loadArea($this->getLayout()->getArea());”
This sets “adminhtml” as the area for the current page.