Prechádzať zdrojové kódy

[HttpFoundation] Added removeFlash & clearFlashes methods to the Session

Jordi Boggiano 14 rokov pred
rodič
commit
584769dd16

+ 10 - 0
src/Symfony/Component/HttpFoundation/Session.php

@@ -236,6 +236,16 @@ class Session implements \Serializable
         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) {