I am wokring on coding standard and need to replace echo with $this->getResponse()->setBody($relatedBlock) But below code is not working for me. with echo it working perfectly.
public function showpopupAction(){
$this->loadLayout();
if($this->getLayout()->getBlock('minicart_head')){
$relatedBlock = $this->getLayout()->getBlock('minicart_head')->toHtml();
$this->getResponse()->clearHeaders()->setHeader('Content-type','text/xml',true);
$this->getResponse()->setBody($relatedBlock);
}
return
do the trick for me. You can put as answer.$this->getResponse()->setBody($relatedBlock); return;
the trick will stop executing the other script