魔术方法，用户读取当前视图数据（包含全局数据）

@param   string $key 变量名
@return  mixed
@throws  ViewException
174759
public function & __get($key)
    {
        if (array_key_exists($key, $this->_data))
        {
            return $this->_data[$key];
        }
        elseif (array_key_exists($key, View::$_globalData))
        {
            return self::$_globalData[$key];
        }
        else
        {
            throw new ViewException('View variable is not set: :var', [
                ':var' => $key
            ]);
        }
    }
168433
public function get($key){

		if(!is_null($this->args))
			if(in_array($key, array_keys($this->args)))
				return $this->args[$key];

		return null;
	}
773192
public function resolve( $rootKey, $key = null )
	{
		if ( !$key )
		{
			if ( !is_null( $this->def ) )
				return $this->get( $this->def );

			throw new BindingException( "The default key was never set for Service Resolver [" . static::class . "]" );
		}

		if ( !is_string( $key ) )
			throw new ResolverException( "Key must be a string" );

		if ( $result = $this->get( $key ) )
			return $result;

		throw new ResolverException( "Failed to resolve [" . $rootKey . ( empty( $key ) ? "" : "." . $key ) . "]" );
	}
620958
public function get(string $key)
    {
        if (isset($this->App->Config->§options[$key])) {
            return $this->App->Config->§options[$key];
        } // Optimized. Values CAN be `null` however.

        // Else if the key does not exist at all, throw exception.
        if (!array_key_exists($key, $this->App->Config->§options)) {
            throw $this->c::issue(sprintf('Unknown option key: `%1$s`.', $key));
        }
        return null; // Default return value.
    }
783954
public function viewData($key=null, $value=null)
    {
        $view = $this->getView();
        if (!$key) {
            return $view->getData();
        } elseif (is_null($value) && is_string($key)) {
            $viewData = $view->getData();
            return isset($viewData[$key]) ? $viewData[$key] : null;
        } else {
            $view->setData($key, $value);
            return $this;
        }
    }
467321
public function &__get($key)
    {
        if (!isset($this->$key)) {
            $this->$key = null;
        }

        return $this->$key;
    }
651033
public function offsetGet($key)
    {
        if (!isset($this->keys[$key])) {
            throw new \Exception($key);
        }

        if (
          !is_object($this->values[$key])
          || !method_exists($this->values[$key], '__invoke')
        ) {
            return $this->values[$key];
        }

        $value = $this->values[$key]($this);
        $this->values[$key] = $value;
        return  $value;
    }
480212
public function get($key)
    {
        if (!$this->has($key)) {
            throw new \Exception(sprintf('Identifier "%s" is not defined.', $key));
        }
        try {
            return $this->offsetGet($key);
        } catch (\Exception $exception) {
            throw $exception;
        }
    }
1313576
public function getParam($key)
    {
        if (array_key_exists($key, $this->params)) {
            return $this->params[$key];
        }

        throw new RuntimeException(sprintf('Parameter with key "%s" is not found.', $key));
    }
243573
public function getArray($key)
    {
        try {
            $result = $this->get(self::DATA_ARRAY, $key);
            if (!settype($result, 'array')) {
                return null;
            }
        } catch (\Exception $e) {
            return null;
        }
        return $result;
    }
96829
public static function getInstance($key = 'default')
    {
        if ((string) $key = '') {
            throw new Exception('Invalid object key');
        }

        if (!Arr::key($key, self::$_objects)) {
            self::$_objects[$key] = new self();
        }

        return self::$_objects[$key];
    }
575336
public function touchKey($key)
    {
        if ($this->supportsTouching()) {
            return $this->driver->touchKey($key);
        }
        throw new StorageException(StorageException::DRIVER_DOES_NOT_SUPPORT_TOUCH, [get_class($this->driver)]);
    }
1207279
public function findByKey(string $key) {
        if (!$this->root) {
            return null;
        }

        return $this->root->findByKey($key);
    }
1082517
public function getDate($key)
    {
        try {
            $result = $this->get(self::DATE, $key);
            if (!$result instanceof DateTime) {
                return null;
            }
        } catch (\Exception $e) {
            return null;
        }
        return $result;
    }
597673
public function get($key)
    {
        if ($this->has($key) === false) {
            throw new \RuntimeException(sprintf('Element with key: "%s" not found.', $key));
        }

        return $this->elements[$key];
    }
73024
public function get($key)
    {
        if ($this->has($key)) {
            return $this->templates[(string) $key];
        }

        return null;
    }
261462
protected function get($key)
    {
        $this->checkForNonEmptyKey($key);
        if (!$this->settingsHaveBeenRetrieved) {
            $this->retrieveSettings();
        }
        if (!isset($this->cachedSettings[$key])) {
            return null;
        }

        return $this->cachedSettings[$key];
    }