Saturday 20 July 2013

Call Direct Template page from controller in magento.

Call Direct Template page from controller.

if ($this->getRequest()->getParam('result') > 0) {
$this->loadLayout();
            if((bool) $this->getRequest()->getParam('result')){
                $this->_initLayoutMessages('customer/session');
                $this->_initLayoutMessages('catalog/session');
                 if ($block = $this->getLayout()->getBlock('root')) {
                    $block->setRefererUrl($this->_getRefererUrl());
                }
                $this->getLayout()->getBlock('root')->setTemplate('quiz/result_rating.phtml'); //changes the root which if you want template.
            }
            $this->renderLayout();
            return $this;
}

No comments:

Post a Comment