我需要 cakephp 方面的简单帮助。这可能是关于路线的问题,但我不知道如何解决这个问题。
我已将我所有的 css 文件放在我应用程序的 webroot/css 中。在我的默认布局中,我只是放了一个 html 链接 <link href="css/bootstrap.min.css" rel="stylesheet">
.它适用于我的网址 localhost/items (index function)
, 但当我做 localhost/items/view/2 (view function)
时它不起作用.我该如何解决这个问题?
最佳答案
使用 HtmlHelper 生成指向 webroot 中 Assets 的链接,如 manual 所示。 .
关于php - cakephp 中 webroot 中的 css 文件并与 html 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21798900/