Symfony\Component\HttpFoundation\Session::get PHP Method

get() public method

Returns an attribute.
public get ( string $name, mixed $default = null ) : mixed
$name string The attribute name
$default mixed The default value
return mixed
    public function get($name, $default = null)
    {
        return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default;
    }

Usage Example

 public function get($state)
 {
     if (!in_array($state, array_keys($this->states))) {
         throw new \RunTimeException("Requested state {$state} does not exist");
     }
     return $this->session->get($this->prefix . '.' . $state, $this->states[$state]);
 }
All Usage Examples Of Symfony\Component\HttpFoundation\Session::get