Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/248.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento CMS页面-包含外部PHP脚本_Php_Magento - Fatal编程技术网

Magento CMS页面-包含外部PHP脚本

Magento 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

我想在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 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"}}