问题描述
我正在将symfony 1.4的setFlash和hasFlash方法与WAMP 2.0一起使用
I'm using the setFlash and hasFlash methods of symfony 1.4 with WAMP 2.0
在本地使用我的frontend_dev应用程序,一切正常.但是在生产环境中,我的测试$this->forward404Unless($user->hasFlash('resultsArray'));
失败.
Locally with my frontend_dev app, all work fine.But in production environment, my test $this->forward404Unless($user->hasFlash('resultsArray'));
fails.
我认为默认情况下启用了flash方法.我该怎么做才能使其正常工作?
I thought that the flash methods where enabled by default. What can I do to make it works please ?
我发现了一条有趣的错误消息.
Edit : I found an interesting error message.
这是我的filters.yml文件
Here is my filters.yml file
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/12-Filters
rendering: ~
security: ~
# insert your own filters here
cache: ~
flash: ~
execution: ~
在frontend_prod.log中,我有:
In the frontend_prod.log, I have :
推荐答案
您是否在重定向/转发上下文中调用 executeShowResult 操作?闪光灯的寿命有限,并且在下一个请求后将消失.显然, resultsArray 已被清除.
Do you call the executeShowResult action in a redirect/forward context? The flash has a limited lifetime and it will disappear after the very next request. Clearly the resultsArray has been flushed out.
这篇关于无法在产品环境中使用Flash方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!