2015-07-13 71 views
1

我在catalog/product/new.phtml中创建了一个new.phtml页面。 其中包含new/latest products。 我有另一个.phtml页[product_slider.phtml]。我想添加new.phtmlproduct_slider.phtml 是这种可能性。如何使用..任何想法。?在另一个.phtml页面中显示.phtml页面

回答

0

回答

尝试我得到了解决方案的代码之后。

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalog/product/new.phtml')->toHtml(); ?> 
3
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('custom/product_slider.phtml')->toHtml(); ?> 

你必须确保块类型,而不是core/template

4

要在其他一个.phtml页面显示一个.phtml页。您可以使用:

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('path after template dir/filename.phtml')->toHtml(); ?> 
相关问题