public function NamespacedAttributeBag::get

Returns an attribute.

Parameters

string $name The attribute name:

mixed $default The default value if not found.:

Return value

mixed

Overrides AttributeBag::get

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php, line 55

Class

NamespacedAttributeBag
This class provides structured storage of session attributes using a name spacing character in the key.

Namespace

Symfony\Component\HttpFoundation\Session\Attribute

Code

public function get($name, $default = null) {
  $attributes = $this
    ->resolveAttributePath($name);
  $name = $this
    ->resolveKey($name);
  return array_key_exists($name, $attributes) ? $attributes[$name] : $default;
}