如何在magento的specfic页面调用.phtml块?

use*_*046 3 magento

我如何在测试页面使用test.phtml我使用下面的代码,但它没有工作

{{block type='core/template' name='Test' template='goodtest/test.phtml'}} 
Run Code Online (Sandbox Code Playgroud)

但它没有在页面上显示任何内容.我错过了什么吗?我需要将一些代码放在其他文件中,例如page.xml或local.xml.

谢谢

Sha*_*med 15

您的代码看起来很适合在CMS页面中添加.如果你想在.phtml文件中添加.phtml文件,那么你可以像这样使用.您不需要在xml文件中添加任何内容

    <?php 
  echo $this->getLayout()->createBlock('core/template')->setTemplate('goodtest/test.phtml')->toHtml();
?>
Run Code Online (Sandbox Code Playgroud)

谢谢