Welcome Guest, Not a member yet? Register   Sign In
isset on flashdata
#1

[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!!
#2

[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).




Theme © iAndrew 2016 - Forum software by © MyBB