You are here

public function AutoExpireFlashBag::initialize in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php \Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag::initialize()

Initializes the Bag.

Parameters

array $array:

Overrides SessionBagInterface::initialize

File

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

Class

AutoExpireFlashBag
AutoExpireFlashBag flash message container.

Namespace

Symfony\Component\HttpFoundation\Session\Flash

Code

public function initialize(array &$flashes) {
  $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'] : array();
  $this->flashes['new'] = array();
}