如何在 magento .phtml 文件中渲染块?

cap*_*ino 5 magento

我正在尝试将 magento 联系表单呈现为 .phtml 文件,但我在 Google 上找不到任何内容来获取 PHP 代码来执行此操作。

我只知道在magento的CMS系统中使用的代码是:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}
Run Code Online (Sandbox Code Playgroud)

有什么线索吗?

Ada*_*oss 3

只要正确放置 XML 块,您就应该能够在 phtml 文件中将其显示出来:

<?php echo $this->getChildHtml('contactForm') ?>
Run Code Online (Sandbox Code Playgroud)