Monday 1 September 2014

how to call block in controller in magento

<?php 
public function indexAction()
{
//Get current layout state
$this->loadLayout();
$block = $this->getLayout()->createBlock(
'Mage_Core_Block_Template',
'my_block_name_here',
array('template' => 'codeline/developer.phtml')
);
$this->getLayout()->getBlock('content')->append($block);
//Release layout stream... lol... sounds fancy
$this->renderLayout();
}
?>

No comments:

Post a Comment