From c15e17c3fe6110a4e08a56cde3514c02359fe080 Mon Sep 17 00:00:00 2001 From: Mike Funk Date: Thu, 23 Feb 2012 14:56:18 -0500 Subject: added all_flashdata function to Session.php --- system/libraries/Session.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'system/libraries/Session.php') diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 66b39a6a2..a594d24ef 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -468,6 +468,29 @@ class CI_Session { { return $this->userdata; } + + // -------------------------------------------------------------------------- + + /** + * Fetch all flashdata + * + * @return array + */ + public function all_flashdata() + { + $out = array(); + + // loop through all userdata + foreach ($this->all_userdata() as $key => $val) + { + // if it contains flashdata, add it + if (strpos($key, 'flash:old:') !== FALSE) + { + $out[$key] = $val; + } + } + return $out; + } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b