Neos\Neos\Routing\FrontendNodeRoutePartHandler::buildContextFromRequestPath PHP Method

buildContextFromRequestPath() protected method

Creates a content context from the given request path, considering possibly mentioned content dimension values.
protected buildContextFromRequestPath ( &$requestPath ) : ContentContext
return Neos\Neos\Domain\Service\ContentContext The built content context
    protected function buildContextFromRequestPath(&$requestPath)
    {
        $workspaceName = 'live';
        $dimensionsAndDimensionValues = $this->parseDimensionsAndNodePathFromRequestPath($requestPath);
        // This is a workaround as NodePaths::explodeContextPath() (correctly)
        // expects a context path to have something before the '@', but the requestPath
        // could potentially contain only the context information.
        if (strpos($requestPath, '@') === 0) {
            $requestPath = '/' . $requestPath;
        }
        if ($requestPath !== '' && NodePaths::isContextPath($requestPath)) {
            try {
                $nodePathAndContext = NodePaths::explodeContextPath($requestPath);
                $workspaceName = $nodePathAndContext['workspaceName'];
            } catch (\InvalidArgumentException $exception) {
            }
        }
        return $this->buildContextFromWorkspaceNameAndDimensions($workspaceName, $dimensionsAndDimensionValues);
    }