[eluser]jwindhorst[/eluser]
I've been using flashdata to send errors when I need to to redirect a user to a new location with errors on the page. I use
Code:
session->set_flashdata('errors', array('error message goes here.'))
On the page that the user is redirected to, specifically in the controller, I have this code:
Code:
$errors=$this->session->flashdata('errors');
if(is_array($errors))
$data['errors']=$errors;
I had to test to see if the result from flashdata was indeed an array. Even when errors is not set, the call to flashdata will indeed return "something" even if it is 'NULL'. So using isset, or even count on the return value will give you unexpected results.
It would be really cool if calling flashdata on an item that was not set returned something more programatically intuitive; like false for example.
Anyone know if there is a good reason for it behaving this way?
Thanks.