I'm currently using Symfony 3.3.6 and experiencing some issues with flashbag messages.
The problem basically is;
The flashbag messages work in development environment, but does not in production/live environment.
$this->addFlash('success', 'Some kind of message');
The above code is being used in the controller to add the flashbag message.
{% for label, messages in app.flashes %}
{% for message in messages %}
<div class="alert alert-{{ label }}">
{{ message }}
</div>
{% endfor %}{% endfor %}
Is the code which is being used in twig to retrieve the messages. Once again this works in dev environment, but for some reason does not in production.
In Flash-Messages in Symfony2 doesn't seem to work in my twig-template somebody states that:
'I just figure out that flash messages are not working if intercept_redirects
is true
in debug mode.' This is also the case in my configuration. But what does this option actually mean? I don't want to put simply intercept_redirects: false
in the production config.yml
as a fix, unless this is the real fix for the issue.
Thanks.