Your Location is: Home > Php

Mage::app()->getLayout()->getBlock('header') returning false in magento 1,7

From: Haiti View: 3592 avinash 

Question

In welcome.php file of magento 1.7

Mage::app()->getLayout()->getBlock('header')->getWelcome(); getBlock('header') returning false please check code sample.

    protected function _toHtml()
    {
        if (isset($this->_blocks[$name])) {
            echo $this->_blocks[$name];
        } else {
            return Mage::app()->getLayout()->getBlock('header')->getWelcome();
            return false;
        }
    }
}

Best answer