【发布时间】:2015-08-26 15:05:32
【问题描述】:
由于某种原因,当我运行此代码时,在添加 ID(第二个块)时,我的模板似乎不再找到我的 CSS/图像文件。
但是代码完全一样(除了使用@id 来请求参数)。使用的代码框架是Fat-free框架。
这是我的代码:
$f3->route('GET /detail',
function($f3, $params) {
$test = new renderEngine;
$test->detail($f3, $params['id']);
}
);
$f3->route('GET /detail/@id',
function($f3, $params) {
$test = new renderEngine;
$test->detail($f3, $params['id']);
}
);
在 Sources 选项卡中签入 Chrome 开发人员(或者您调用窗口)时,我可以看到在第一种情况下它是:
>localhost
>
>--Audiodelight (name of my rootfolder)
>
>----css (with in that map my css files)
在第二种情况下,我得到了
>localhost
>
>--Audiodelight/detail (Which seems to be the problem)
>
>----css (with in that map my css files)
有谁知道它为什么在子目录中搜索?它正在寻找的目录甚至都不存在。或者知道如何修复它?
【问题讨论】:
-
您的 HTML 文件中似乎有错误。您可能正在相对引用您的 CSS 文件。见this topic。
-
将
标签添加到您的 html 文件中。 -
确实!非常感谢!
标签: php url-routing fat-free-framework