Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php symfony生产环境中没有flashbag消息_Php_Symfony_Session_Frameworks - Fatal编程技术网

Php symfony生产环境中没有flashbag消息

Php symfony生产环境中没有flashbag消息,php,symfony,session,frameworks,Php,Symfony,Session,Frameworks,我目前正在使用Symfony 3.3.6,在flashbag消息方面遇到一些问题 问题基本上是, flashbag消息在开发环境中工作,但在生产/实时环境中不工作 $this->addFlash('success', 'Some kind of message'); 控制器中使用上述代码添加flashbag消息 {% for label, messages in app.flashes %} {% for message in messages %} <div class=

我目前正在使用Symfony 3.3.6,在flashbag消息方面遇到一些问题

问题基本上是,

flashbag消息在开发环境中工作,但在生产/实时环境中不工作

$this->addFlash('success', 'Some kind of message');
控制器中使用上述代码添加flashbag消息

{% for label, messages in app.flashes %}
{% for message in messages %}
    <div class="alert alert-{{ label }}">
        {{ message }}
    </div>
{% endfor %}{% endfor %}
{%用于标签,app.flash%中的消息]
{消息%中的消息为%s}
{{message}}
{%endfor%}{%endfor%}
是在twig中用于检索消息的代码。这同样适用于开发环境,但由于某些原因,不适用于生产环境

在某些国家: “我刚刚发现,如果调试模式下
intercept\u redirects
true
,flash消息不起作用。”在我的配置中也是如此。但这一选择究竟意味着什么?我不想简单地将
intercept\u redirects:false
放在生产
config.yml
中作为修复,除非这是问题的真正修复


谢谢。

Where
$this->addFlash(“成功”,“某种消息”)被调用了吗?在什么条件下被称为?您是否在prod中尝试过
cache:clear
?我无法为3.3.6+prod env复制您的问题。此外,
拦截\u重定向
只是dev env的
web\u探查器
配置的一部分,因此它不应影响您在prod env中的
WebProfilerBundle
未加载。$this->addFlash在控制器中调用。隐藏物clear没有改变任何事情。Flash消息确实有效,但仅在dev模式下有效。我没有更改默认的产品配置设置。php会话是否在生产环境中工作?Where
$this->addFlash('success','something message')被调用了吗?在什么条件下被称为?您是否在prod中尝试过
cache:clear
?我无法为3.3.6+prod env复制您的问题。此外,
拦截\u重定向
只是dev env的
web\u探查器
配置的一部分,因此它不应影响您在prod env中的
WebProfilerBundle
未加载。$this->addFlash在控制器中调用。隐藏物clear没有改变任何事情。Flash消息确实有效,但仅在dev模式下有效。我没有更改默认的产品配置设置。php会话是否正在生产中工作?