I want to set template in Block custom.php. how can i do it? I tried following:
protected function _prepareLayout() {
$this->getLayout()->createBlock('Xyaddons\Productzoom\Block\Product\View')->setTemplate('product/image.phtml')->toHtml();
return parent::_prepareLayout();
}
it's not running successfully.
Add new quetion
I want create funcion in custom block use to set template. it same
public function setCustomTemplate(){
if($isActive ==="1"){
return $this->getLayout()->getBlock('.....')->setTemplate('custom/view.phtml');
}
}
how do it? any thank help :)