src/Leevel/Session/Session.php
protected function getPartData(string $key, $defaults = null, ?string $type = null)
    {
        list($key, $name) = explode('\\', $key);

        if ('flash' === $type) {
            $key = $this->flashDataKey($key);
        }

        $value = $this->get($key);

        if (is_array($value)) {
            if (!strpos($name, '.')) {
                return array_key_exists($name, $value) ? $value[$name] : $defaults;
            }

            $parts = explode('.', $name);

            foreach ($parts as $part) {
                if (!isset($value[$part])) {
                    return $defaults;
                }

                $value = $value[$part];
            }

            return $value;
        }

        return $defaults;
    }
protected function getPartData(string $key, $defaults = null, ?string $type = null)
    {
        list($key, $name) = explode('\\', $key);

        if ('flash' === $type) {
            $key = $this->flashDataKey($key);
        }

        $value = $this->get($key);

        if (is_array($value)) {
            if (!strpos($name, '.')) {
                return array_key_exists($name, $value) ? $value[$name] : $defaults;
            }

            $parts = explode('.', $name);

            foreach ($parts as $part) {
                if (!isset($value[$part])) {
                    return $defaults;
                }

                $value = $value[$part];
            }

            return $value;
        }

        return $defaults;
    }
返回部分闪存数据.

@param string $key
@param mixed  $defaults
@param string $type

@return mixed