2017-01-25 46 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'); ?> 
相关问题