【发布时间】:2015-10-16 23:53:53
【问题描述】:
我正在使用 UserFrosting,到目前为止,我已经能够将所有默认元素导入主页。但是,我现在添加了第二个页面,但是当我从主页复制以下代码时没有任何反应:
{% include 'common/components/head.html' %}
<rest of code>
{% include 'common/components/main-nav.html' %}
<rest of code>
{% include 'common/components/footer.html' %}
{% include 'common/components/jumbotron-links.html' %}
然后我使用了以下 php 代码:
<?php include("../userfrosting/templates/common/components/head.html"); ?>
这似乎可行,但该页面仅显示在 head.html 文件中找到的此代码:
{% for item in includeCSS(page_group|default("common")) %} {% endfor %} {% for item in includeJSTop(page_group|default("common")) %} {% endfor %}
这显然不是很有用!
当我将 home 和 page2.php 文件保存在同一个文件夹中(在 localhost/userfrosting/templates/common 中)时,我收到错误 404。当我将文件移动到默认的 UserFrosting 主页目录(即 home. html 文件实际上不在)在 localhost/public 中,我只得到上面的代码。
似乎我在这里遗漏了一些非常基本的东西,但希望能得到一些帮助。谢谢。
【问题讨论】:
-
你不应该包含 head.html 而是你的实际页面 (page2.php ?)
-
这不会导入我所在的页面(并尝试将页眉/页脚导入)吗?
标签: php header footer userfrosting