Neos\Fusion\TypoScriptObjects\Helpers\FusionPathProxy::offsetGet PHP 메소드

offsetGet() 공개 메소드

Return the object at $offset; evaluating simple types right away, and wrapping arrays into ourselves again.
public offsetGet ( string $offset ) : mixed | FusionPathProxy
$offset string
리턴 mixed | FusionPathProxy
    public function offsetGet($offset)
    {
        if (!isset($this->partialTypoScriptTree[$offset])) {
            return null;
        }
        if (!is_array($this->partialTypoScriptTree[$offset])) {
            // Simple type; we call "evaluate" nevertheless to make sure processors are applied.
            return $this->fusionRuntime->evaluate($this->path . '/' . $offset);
        } else {
            // arbitrary array (could be Eel expression, TypoScript object, nested sub-array) again, so we wrap it with ourselves.
            return new FusionPathProxy($this->templateImplementation, $this->path . '/' . $offset, $this->partialTypoScriptTree[$offset]);
        }
    }