You are here

public function AttributeBag::get in Zircon Profile 8

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

Returns an attribute.

Parameters

string $name The attribute name:

mixed $default The default value if not found:

Return value

mixed

Overrides AttributeBagInterface::get

1 method overrides AttributeBag::get()
NamespacedAttributeBag::get in vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php
Returns an attribute.

File

vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php, line 81

Class

AttributeBag
This class relates to session attribute storage.

Namespace

Symfony\Component\HttpFoundation\Session\Attribute

Code

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