LiquidContext::fetch PHP Method

fetch() public method

Fetches the current key in all the scopes
public fetch ( string $key ) : mixed
$key string
return mixed
    public function fetch($key)
    {
        foreach ($this->environments as $environment) {
            if (array_key_exists($key, $environment)) {
                return $environment[$key];
            }
        }
        foreach ($this->_assigns as $scope) {
            if (array_key_exists($key, $scope)) {
                $obj = $scope[$key];
                if ($obj instanceof LiquidDrop) {
                    $obj->setContext($this);
                }
                return $obj;
            }
        }
    }