Commit 9a42ad67 by Alexander Makarov

Merge pull request #5256 from nkovacs/patch-1

[skip ci] Update documentation to mention addFlash
parents b672b818 f41abf91
......@@ -625,8 +625,9 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
* @param mixed $defaultValue value to be returned if the flash message does not exist.
* @param boolean $delete whether to delete this flash message right after this method is called.
* If false, the flash message will be automatically deleted in the next request.
* @return mixed the flash message
* @return mixed the flash message or an array of messages if addFlash was used
* @see setFlash()
* @see addFlash()
* @see hasFlash()
* @see getAllFlashes()
* @see removeFlash()
......@@ -664,13 +665,16 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
*
* With the above code you can use the [bootstrap alert][] classes such as `success`, `info`, `danger`
* as the flash message key to influence the color of the div.
*
* Note that if you use [[addFlash()]], `$message` will be an array, and you will have to adjust the above code.
*
* [bootstrap alert]: http://getbootstrap.com/components/#alerts
*
* @param boolean $delete whether to delete the flash messages right after this method is called.
* If false, the flash messages will be automatically deleted in the next request.
* @return array flash messages (key => message).
* @return array flash messages (key => message or key => [message1, message2]).
* @see setFlash()
* @see addFlash()
* @see getFlash()
* @see hasFlash()
* @see removeFlash()
......@@ -712,6 +716,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
* regardless if it is accessed or not. If true (default value), the flash message will remain until after
* it is accessed.
* @see getFlash()
* @see addFlash()
* @see removeFlash()
*/
public function setFlash($key, $value = true, $removeAfterAccess = true)
......@@ -732,6 +737,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
* regardless if it is accessed or not. If true (default value), the flash message will remain until after
* it is accessed.
* @see getFlash()
* @see setFlash()
* @see removeFlash()
*/
public function addFlash($key, $value = true, $removeAfterAccess = true)
......@@ -758,6 +764,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
* @return mixed the removed flash message. Null if the flash message does not exist.
* @see getFlash()
* @see setFlash()
* @see addFlash()
* @see removeAllFlashes()
*/
public function removeFlash($key)
......@@ -777,6 +784,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
* by this method.
* @see getFlash()
* @see setFlash()
* @see addFlash()
* @see removeFlash()
*/
public function removeAllFlashes()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment