Neos\Neos\ViewHelpers\Rendering\AbstractRenderingStateViewHelper::getContextNode PHP Méthode

getContextNode() protected méthode

Get a node from the current TypoScript context if available.
protected getContextNode ( ) : Neos\ContentRepository\Domain\Model\NodeInterface | null
Résultat Neos\ContentRepository\Domain\Model\NodeInterface | null
    protected function getContextNode()
    {
        $baseNode = null;
        $view = $this->viewHelperVariableContainer->getView();
        if ($view instanceof TypoScriptAwareViewInterface) {
            $typoScriptObject = $view->getTypoScriptObject();
            $currentContext = $typoScriptObject->getTsRuntime()->getCurrentContext();
            if (isset($currentContext['node'])) {
                $baseNode = $currentContext['node'];
            }
        }
        return $baseNode;
    }
AbstractRenderingStateViewHelper