public function getAllFlashes($delete = false)
    {
        $counters = $this->get($this->flashParam, []);
        $flashes = [];
        foreach (array_keys($counters) as $key) {
            if (array_key_exists($key, $this->data)) {
                $flashes[$key] = $this->data[$key];
                if ($delete) {
                    unset($counters[$key], $this->data[$key]);
                } elseif ($counters[$key] < 0) {
                    // mark for deletion in the next request
                    $counters[$key] = 1;
                }
            } else {
                unset($counters[$key]);
            }
        }

        $this->data[$this->flashParam] = $counters;

        return $flashes;
    }
public function getAllFlashes($delete = false)
    {
        $counters = $this->get($this->flashParam, []);
        $flashes = [];
        foreach (array_keys($counters) as $key) {
            if (array_key_exists($key, $this->data)) {
                $flashes[$key] = $this->data[$key];
                if ($delete) {
                    unset($counters[$key], $this->data[$key]);
                } elseif ($counters[$key] < 0) {
                    // mark for deletion in the next request
                    $counters[$key] = 1;
                }
            } else {
                unset($counters[$key]);
            }
        }

        $this->data[$this->flashParam] = $counters;

        return $flashes;
    }
public function getAllFlashes ( $ delete = false ) { $ counters = $ this -> get ( $ this -> flashParam , [ ] ) ; $ flashes = [ ] ; foreach ( array_keys ( $ counters ) as $ key ) { if ( array_key_exists ( $ key , $ this -> data ) ) { $ flashes [ $ key ] = $ this -> data [ $ key ] ; if ( $ delete ) { unset ( $ counters [ $ key ] , $ this -> data [ $ key ] ) ; } elseif ( $ counters [ $ key ] < 0 ) { // mark for deletion in the next request $ counters [ $ key ] = 1 ; } } else { unset ( $ counters [ $ key ] ) ; } } $ this -> data [ $ this -> flashParam ] = $ counters ; return $ flashes ; }
Returns all flash messages.

You may use this method to display all the flash messages in a view file:

```php
<?php
foreach ($app->session->getAllFlashes() as $key => $message) {
echo '<div class="alert alert-' . $key . '">' . $message . '</div>';
} ?>
```

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 bool $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 or key => [message1, message2]).
@see setFlash()
@see addFlash()
@see getFlash()
@see hasFlash()
@see removeFlash()
Returns all flash messages .