protected function getFlashes()
    {
        /* @var $session \yii\web\Session */
        $session = Yii::$app->has('session', true) ? Yii::$app->get('session') : null;
        if ($session === null || !$session->getIsActive()) {
            return [];
        }

        $counters = $session->get($session->flashParam, []);
        $flashes = [];
        foreach (array_keys($counters) as $key) {
            if (array_key_exists($key, $_SESSION)) {
                $flashes[$key] = $_SESSION[$key];
            }
        }
        return $flashes;
    }
protected function getFlashes()
    {
        /* @var $session \yii\web\Session */
        $session = Yii::$app->has('session', true) ? Yii::$app->get('session') : null;
        if ($session === null || !$session->getIsActive()) {
            return [];
        }

        $counters = $session->get($session->flashParam, []);
        $flashes = [];
        foreach (array_keys($counters) as $key) {
            if (array_key_exists($key, $_SESSION)) {
                $flashes[$key] = $_SESSION[$key];
            }
        }
        return $flashes;
    }
protected function getFlashes ( ) { /* @var $session \yii\web\Session */ $ session = Yii :: $ app -> has ( 'session' , true ) ? Yii :: $ app -> get ( 'session' ) : null ; if ( $ session === null || ! $ session -> getIsActive ( ) ) { return [ ] ; } $ counters = $ session -> get ( $ session -> flashParam , [ ] ) ; $ flashes = [ ] ; foreach ( array_keys ( $ counters ) as $ key ) { if ( array_key_exists ( $ key , $ _SESSION ) ) { $ flashes [ $ key ] = $ _SESSION [ $ key ] ; } } return $ flashes ; }
Getting flash messages without deleting them or touching deletion counters

@return array flash messages (key => message).
Getting flash messages without deleting them or touching deletion counters