2017-01-25 75 views

回答

1

<?php echo $this->getLayout()->createBlock('responsivebannerslider/index')->setTemplate('responsivebannerslider/index.phtml')->toHtml(); ?>

+0

感謝阿赫塔爾,它的工作... –

2

您可以直接在PHTML模板文件創建的佈局塊從你的模板調用它:

<?php echo $this->getLayout()->createBlock('responsivebannerslider/index')->setTemplate('responsivebannerslider/index.phtml')->toHtml(); ?> 

或者,如果該塊在擴展上市佈局XML文件(將嵌套在參考節點中),並且看起來像這樣:

<block type="responsivebannerslider/index" name="responsivebannerslider_index" as="an_alias" template="responsivebannerslider/index.phtml"> 
    <label>Responsive banner</label> 
</block> 

而且你會打電話來,在喜歡你的模板文件:

<?php echo $this->getChildHtml('an_alias'); ?> 
相關問題