Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AutoExpireFlashBag.php

function AutoExpireFlashBag::initialize

Overrides SessionBagInterface::initialize

File

vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php, line 42

Class

AutoExpireFlashBag
AutoExpireFlashBag flash message container.

Namespace

Symfony\Component\HttpFoundation\Session\Flash

Code

public function initialize(array &$flashes) : void {
    $this->flashes =& $flashes;
    // The logic: messages from the last request will be stored in new, so we move them to previous
    // This request we will show what is in 'display'.  What is placed into 'new' this time round will
    // be moved to display next time round.
    $this->flashes['display'] = \array_key_exists('new', $this->flashes) ? $this->flashes['new'] : [];
    $this->flashes['new'] = [];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal