Magento CMS页面-包含外部PHP脚本
我想在Magento CMS页面中包含外部PHP脚本 e、 gMagento CMS页面-包含外部PHP脚本,php,magento,Php,Magento,我想在Magento CMS页面中包含外部PHP脚本 e、 g **http://myhost/magento/custom/script.php** Magento页面上的结果应该是:“hello” 最简单的方法是什么?最好的方法可能是通过布局更新XML部分(在“设计”选项卡上)。您可以为模板php文件创建新块,也可以使用Mage\u Core\u block\u template。添加以下内容: <reference name="content"> <block
**http://myhost/magento/custom/script.php**
Magento页面上的结果应该是:“hello
”
最简单的方法是什么?最好的方法可能是通过布局更新XML部分(在“设计”选项卡上)。您可以为模板php文件创建新块,也可以使用
Mage\u Core\u block\u template
。添加以下内容:
<reference name="content">
<block type="core/template" name="my_template" template="pat/to/your/template" after="cms_page" />
</reference>
或您可以使用大括号语法来包含.phtml文件,您可以在其中编写PHP代码,如下所示:
{{block type="core/template" name="my-template" template="path/to/your/template.phtml"}}
谢谢
{{block type="core/template" name="my-template" template="path/to/your/template.phtml"}}