【发布时间】:2010-08-05 11:40:44
【问题描述】:
我在这里有点迷路,解决方案可能潜伏在我的眼皮底下,但我无法得到,如果有人可以提供帮助,请想到你们。
问题来了: 我有 Zend Framework 标准文件布局:
Project
-application
-controllers
-views
-layouts
-scripts
-layouts.phtml
-library
-public
-images
-index.php
现在的问题是,我仅通过 images/logo.gif 等引用 layouts.phtml 中的图像,并且在控制器视图 /images/arrow.gif 中也是如此
如果请求很简单http://servername/project/controller就可以了
但如果请求更深,比如http://servername/project/controller/index/page/2
图像会自行损坏,他们显然无法获取路径,我注意到的是,如果我稍后请求,图像路径将是 http://servername/project/controller/index/page/2/images/logo.gif 不存在,图像在 public/images
我的理解是(我也用谷歌搜索了一下)框架知道默认的公共,并且总是将图像路由到公共/图像。但是,这是行不通的。我是否必须添加一些重写规则或其他内容?
有人可以帮忙吗?我将不胜感激!
【问题讨论】:
标签: php zend-framework