Forráskód Böngészése

[HttpFoundation] Added removeFlash & clearFlashes methods to the Session

Jordi Boggiano 14 éve
szülő
commit
584769dd16
1 módosított fájl, 10 hozzáadás és 0 törlés
  1. 10 0
      src/Symfony/Component/HttpFoundation/Session.php

+ 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) {