Neos\Neos\Service\LinkingService::resolveNodeUri PHP Méthode

resolveNodeUri() public méthode

Resolves a given node:// URI to a "normal" HTTP(S) URI for the addressed node.
public resolveNodeUri ( string | Uri $uri, Neos\ContentRepository\Domain\Model\NodeInterface $contextNode, ControllerContext $controllerContext, boolean $absolute = false ) : string
$uri string | Neos\Flow\Http\Uri
$contextNode Neos\ContentRepository\Domain\Model\NodeInterface
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext
$absolute boolean
Résultat string
    public function resolveNodeUri($uri, NodeInterface $contextNode, ControllerContext $controllerContext, $absolute = false)
    {
        $targetObject = $this->convertUriToObject($uri, $contextNode);
        if ($targetObject === null) {
            $this->systemLogger->log(sprintf('Could not resolve "%s" to an existing node; The node was probably deleted.', $uri));
            return null;
        }
        return $this->createNodeUri($controllerContext, $targetObject, null, null, $absolute);
    }

Usage Example

Exemple #1
0
 /**
  * @param string|Uri $uri
  * @param NodeInterface $contextNode
  * @param ControllerContext $controllerContext
  * @return string
  */
 public function resolveNodeUri($uri, NodeInterface $contextNode, ControllerContext $controllerContext)
 {
     return $this->linkingService->resolveNodeUri($uri, $contextNode, $controllerContext);
 }