public function render($node = null, $format = null, $absolute = false, array $arguments = array(), $section = '', $addQueryString = false, array $argumentsToBeExcludedFromQueryString = array(), $baseNodeName = 'documentNode', $nodeVariableName = 'linkedNode', $resolveShortcuts = true)
{
$baseNode = null;
if (!$node instanceof NodeInterface) {
$baseNode = $this->getContextVariable($baseNodeName);
if (is_string($node) && substr($node, 0, 7) === 'node://') {
$node = $this->linkingService->convertUriToObject($node, $baseNode);
}
}
try {
$uri = $this->linkingService->createNodeUri($this->controllerContext, $node, $baseNode, $format, $absolute, $arguments, $section, $addQueryString, $argumentsToBeExcludedFromQueryString, $resolveShortcuts);
$this->tag->addAttribute('href', $uri);
} catch (NeosException $exception) {
$this->systemLogger->logException($exception);
} catch (NoMatchingRouteException $exception) {
$this->systemLogger->logException($exception);
}
$linkedNode = $this->linkingService->getLastLinkedNode();
$this->templateVariableContainer->add($nodeVariableName, $linkedNode);
$content = $this->renderChildren();
$this->templateVariableContainer->remove($nodeVariableName);
if ($content === null && $linkedNode !== null) {
$content = $linkedNode->getLabel();
}
$this->tag->setContent($content);
$this->tag->forceClosingTag(true);
return $this->tag->render();
}