Session Flashdata will not display until 2nd page load |
[eluser]RJ[/eluser]
Hello, I have users running through a Beta signup sequence. Once the email has been successfully submitted a quick bit of flash data is added and a new view (pending) is loaded (see code below): Code: if ( !$send ) The display: Code: <h2>Almost done!</h2> The problem is when the system takes you to either of these pages the flashdata does not display UNTIL you refresh the page or go back to the main page. It looks like the template library is not refreshing (or triggering) a refresh for the message to appear (best guess). Any thoughts how to solve? Thanks
[eluser]louisl[/eluser]
You need to do this a different way, the flash data is working as intended ie setting as the page processes. That means it can't be read until you go to another page or refresh the one you're on. It's a bit like trying to set a cookie and retrieve it on the same page. Send your view a variable and check for that instead.
[eluser]n0xie[/eluser]
You can take a look at our message library to get what you want.
[eluser]Ninjabear[/eluser]
Personally I do a redirect() instead of a view() that way it loads straight away. What's build() though?
[eluser]InsiteFX[/eluser]
Then redirect like this! Code: redirect('where_to', 'refresh'); InsiteFX
[eluser]William Rufino[/eluser]
yeah, a flashdata will only display on a new page, so you have to redirect! if you want to display it on the same "request" you are, why don't just use a normal attribute on the class? |
Welcome Guest, Not a member yet? Register Sign In |