Welcome Guest, Not a member yet? Register   Sign In
getting flashdata from view
#1

[eluser]JimmyPHP[/eluser]
How do I access flashdata from a view?
In one controller I have
Code:
$this->session->set_flashdata('message', 'Hello World');
redirect('/some_other_controller/action');

Now, do I then access $this->ci->session->flashdata('message') from the /some_other_controller/action which is then passed to a view via the typical $data array? Or can I just get the flashdata from the eventual view I end up at? And how do I reference it there if I do?

Thanks
#2

[eluser]OES[/eluser]
On the page where you hace redirected to you will collect like this.

$data['myvar'] = $this->session->flashdata('message');

Hope this helps.




Theme © iAndrew 2016 - Forum software by © MyBB