简体   繁体   English

Zend ErrorController视图问题

[英]Zend ErrorController view problems

I'm having problems with the view for my error controller view in a ZF application. 我在ZF应用程序中的错误控制器视图的视图有问题。 I am using a default layout, and just adding an error message to it. 我正在使用默认布局,并向其中添加错误消息。 However, my images don't always show up in the view for 404 errors. 但是,我的图像并不总是出现在视图中,显示404错误。

If I type a non-existent controller like : mysite.com/contactasddf, it shows the images fine If I type a legit controller, but non-existent action like: mysite.com/contact/asdf, the images don't show up 如果我键入了一个不存在的控制器,例如:mysite.com/contactasddf,它可以很好地显示图像。如果我键入了一个合法的控制器,但是却不存在操作,例如:mysite.com/contact/asdf,则图像不会显示出来。

Thoughts? 有什么想法吗?

How are you referencing the images? 您如何参考图像?

In HTML, use the BaseUrl helper, eg 在HTML中,使用BaseUrl帮助器,例如

<img src="<?php echo $this->baseUrl('images/foo.jpg') ?>">

Same goes for referencing stylesheets, just use relative paths from the stylesheet location within the CSS, eg 引用样式表也是如此,只是使用CSS中样式表位置的相对路径,例如

background-image: url(../images/foo.jpg);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM