【发布时间】:2012-12-23 12:32:13
【问题描述】:
我正在尝试在名为“index.phtml”的 Zend 布局中包含一个名为“style.css”的文件。 我的文件夹树是:
laltroposto
|-public
| |-index.phtml
| |-css
| | !-style.css
| !-...
|-application
| |-layouts
| | !-scripts
| | !-index.phtml
| !...
!-library
!-...
这是我包含 css 的代码(它在 head 的标签中):
<?php echo $this->headLink()->appendStylesheet('css/style.css'); ?>
我也试过了:
<?php echo $this->headLink()->appendStylesheet('/css/style.css'); ?>
这是我的错误:
Failed to load resource: the server responded with a status of 404 (Not Found) http://www.laltroposto.com/js/jquery.js
有什么帮助吗?
【问题讨论】:
-
HTML 中的输出是什么?您在查看页面时是否收到该错误?好像这与您的 css/style.css 行无关。
-
没有错误,它工作正常,但没有加载 css,Chrome Inspect 对我说:“GET laltroposto.com/css/style.css 404 (Not Found)”
-
您的文档根目录是否指向 laltroposto/public?您可以发布您的 htaccess 的内容吗?
-
抱歉,在哪里可以找到我的 htaccess?
-
你应该有一个公开的 .htaccess 文件(除非你在其他地方有你的重写规则)。
标签: css zend-framework styles head