当您点击“向 friend 发送电子邮件”时,您将被引导至要提交的表单。我想在产品 View 页面中显示此表单,而不是“向 friend 发送电子邮件”链接。如何在view.phtml中调用send.phtml模板? 我尝试给出这个
<?php
echo $this->getLayout()->createBlock("core/template")->setTemplate("sendfriend/send.phtml")->toHtml();?>
但这不起作用,显示错误。请帮忙
最佳答案
使用这个你会缺少 block 类型
<?php
echo $this->getLayout()->createBlock("sendfriend/send")->setTemplate("sendfriend/send.phtml")->toHtml();?>
关于Magento - 如何在查看 phtml 文件中向 friend 表单显示电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33818933/