public function AutoExpireFlashBag::get

Gets and clears flash from the stack.

Parameters

string $type:

array $default Default value if $type does not exist.:

Return value

array

Overrides FlashBagInterface::get

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php, line 102

Class

AutoExpireFlashBag
AutoExpireFlashBag flash message container.

Namespace

Symfony\Component\HttpFoundation\Session\Flash

Code

public function get($type, array $default = array()) {
  $return = $default;
  if (!$this
    ->has($type)) {
    return $return;
  }
  if (isset($this->flashes['display'][$type])) {
    $return = $this->flashes['display'][$type];
    unset($this->flashes['display'][$type]);
  }
  return $return;
}