1

I have code like below

class Digitech_Brandlogo_Adminhtml_BrandlogoController extends Mage_Adminhtml_Controller_Action 
{
    public function indexAction()
    {                          
            $this->loadLayout();
            $this->renderLayout();         
    }
}

I would like to know what will do

$this->loadLayout();
$this->renderLayout();

Actually I would like to know execution flow.

Thanks

3

loadLayout() loads the layout XML for the layout handles <default> and <admin_brandLogo_index> (the route name for this controller action). These handles can be defined in any XML files in app/design/adminhtml/default/default/layout (i.e. in the theme, or its parent theme). From this merged XML it generates a hierarchy of blocks. It executes everything defined in these XML files: instantiates block objects, arranges them, calls actions on them.

renderLayout() calls the render method of the root block. Usually that's toHtml() and the page block with a template like 1column.phtml, but it could be anything that is defined in the XML. This root block subsequently renders its children, if getChildHtml() is called from the template. The result is the complete HTML that will be sent as response.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.