【问题标题】:how to use php scripts in datalife engine template files?如何在 datalife 引擎模板文件中使用 php 脚本?
【发布时间】:2020-05-29 21:04:23
【问题描述】:

我想使用 php 脚本从 DataLife Engine 主页上的数据库中读取和显示某些内容。 有点像最近几期新闻节目。

但是当我在 DataLife Engine 模板文件(扩展名为 .tpl)中调用包含 PHP 脚本的文件时(例如:{include file="test.tpl"}),这个脚本不起作用并且不要'不显示任何东西。

当我在 .tpl 文件中调用这样的 php 文件 ({include file="test.php"}) 时,Data-Life-Engine 向我显示此描述的错误:包含根目录中的文件被拒绝。

请帮助我在 DataLife-Engine 模板文件中使用 PHP 脚本。 谢谢

【问题讨论】:

    标签: datalife-engine


    【解决方案1】:

    首先你必须把你的 PHP 文件放在路径“engine/modules”中。 然后在你的模板文件中调用如下:

    {include file="engine/modules/TEST.php"}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-08-24
      • 1970-01-01
      • 2021-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-04
      • 1970-01-01
      相关资源
      最近更新 更多