public function FlashBag::get

Gets and clears flash from the stack.

Parameters

string $type:

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

Return value

string

Overrides FlashBagInterface::get

File

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

Class

FlashBag
FlashBag flash message container.

Namespace

Symfony\Component\HttpFoundation\Session\Flash

Code

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