From 584769dd164b1e8f82888c88d436f84fc3146aec Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 26 Nov 2010 09:47:32 +0100 Subject: [PATCH] [HttpFoundation] Added removeFlash & clearFlashes methods to the Session --- src/Symfony/Component/HttpFoundation/Session.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/Session.php b/src/Symfony/Component/HttpFoundation/Session.php index 47ce42e89cb5..60b09859bf6f 100644 --- a/src/Symfony/Component/HttpFoundation/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session.php @@ -236,6 +236,16 @@ public function hasFlash($name) return array_key_exists($name, $this->attributes['_flash']); } + public function removeFlash($name) + { + unset($this->attributes['_flash'][$name]); + } + + public function clearFlashes() + { + $this->attributes['_flash'] = array(); + } + public function save() { if (true === $this->started) {