php - SF2 Flash Messages not showing from FlashBag -


I am trying to output a flash message to the screen, although I have no luck in doing so.

This is my current setup, as you can see that my administrator has set up a message and then trying to output my tweep template. In practice, I'm going for a message on this page, so the code is probably not for loop but I do not know why this code is not working for me.

I did not get any errors, nothing on the screen output.

In addition, if I die in code on $ message I get my message that I want to show.

In my Controller:

  $ message = $ this-> Get ('translator') - & gt; Trans ('ContactThanksMessage'); $ This- & gt; Receive ('session') - & gt; GetFlashBag () - & gt; Set ('contact_thanks', array ('message' = & gt; $ message)); $ $ Return - ($ a- this-> the generated URL ("ayrshireminis_contact"));  

In my twegg templates:

  {% if app.session.flashbag.get ('contact_thanks')%} {In the app for Flash Message Session.flashbag.get ('contact_thanks')%} & lt; P & gt; {{Flash message}} & lt; / P & gt; {% Endfor%} {% else%}  

What do you need to know A flash message is found, it is removed in the auto-completion strategy (the default one). Therefore, when you do your if , the flash message is removed in your template by using the method ... you have Trust is the way to check that the flash message is present and then use get to use it.


Comments

Popular posts from this blog

Editing Python Class in Shell and SQLAlchemy -

import - Python ImportError: No module named wmi -

uislider - In a MATLAB GUI, how does one implement a continuously varying slider from a GUIDE created .m file? -