You are here

public function AutoExpireFlashBag::get in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php \Symfony\Component\HttpFoundation\Session\Flash\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

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

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;
}