B-219 Sec-55 Noida, India
+918010221733

How to call a phtml file from controller in magento

<?php
class Namespace_Module_DisplayController extends Mage_Core_Controller_Front_Action
{
public function popupAction()
{
$block = $this->getLayout()->createBlock(‘core/template’)
->setTemplate(‘zipcode/popup.phtml’);
$this->getResponse()->setBody(
$block->toHtml()
);
}
}
(Visited 92 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.