Magento Certified Developer GuideCategory: 3.2 BlocksIs it possible to create an instance of the block and add it to the current layout manually?
Manish Prakash Staff asked 5 years ago

Yes possible to this. There are many functions in the “Mage_Core_Block_Abstract” class.

$block = $this->getLayout()->createBlock('core/text');
$block->setText('Test Test');
$this->append($block);
$this->insert($block); //other functions as well