Flashdata always seems one page behind |
[eluser]gabe[/eluser]
Hi there, just started trying to use the flash. It seems that it is always 1 request behind. Consider the following code Code: $this->session->set_flashdata( 'flash', 'You have already provided us with your details' ); The flash message doesn't show the first time the view is loaded, only if refreshed. How can one get it to show in the view file? I am actually trying to use it along with form validation and my full code looks like this: Code: if( $this->validation->run() == FALSE )
[eluser]Pascal Kriete[/eluser]
The definition of flashdata is that it shows on the next page load. No the next view load. If you need text in a view just pass it as part of the data array.
[eluser]gabe[/eluser]
thanks for the reply. So in what circumstance might you want to use flash data? Just so I can get some idea of when it might be useful for me. Thanks a lot.
[eluser]Derek Allard[/eluser]
The manual gives a few examples of circumstances gabe, take a look. I also gave a few examples on my blog when I originally wrote these. http://www.derekallard.com/blog/post/enh...n-library/
[eluser]Chris.Campbell[/eluser]
I use flash say when an event happens, such as creating an account, logging in, posting..etc ![]()
[eluser]gabe[/eluser]
aha and then after setting the flash redirect to another page? |
Welcome Guest, Not a member yet? Register Sign In |