CodeIgniter Forums
isset on flashdata - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: isset on flashdata (/showthread.php?tid=39479)



isset on flashdata - El Forum - 03-11-2011

[eluser]pabloheim[/eluser]
Hi, im rying to collect a flashdata elemento after a redirect, an for ensuring the opration i want to first check if the element is set
Code:
if(!$this->session->flashdata('hash') || !isset($this->session->flashdata('hash'))){
echo 'error';

}

then i get the following error:
Code:
Fatal error: Can't use method return value in write context in /home/public_html/ci2/application/controllers/test.php on line 197
is it because it is $this->session->flashdata just do an "echo" ?

thanks!!


isset on flashdata - El Forum - 03-11-2011

[eluser]WanWizard[/eluser]
You can not use isset() on a method call.

And it's pointless as well, as flashdata() will always return a value (which is FALSE if the flash variable doesn't exist).