PHP Class Neos\Neos\Service\LinkingService

The target node can be provided as string or as a Node object; if not specified at all, the generated URI will refer to the current document node inside the TypoScript context. When specifying the node argument as string, the following conventions apply: *node starts with /:* The given path is an absolute node path and is treated as such. Example: /sites/acmecom/home/about/us *node does not start with /:* The given path is treated as a path relative to the current node. Examples: given that the current node is /sites/acmecom/products/, stapler results in /sites/acmecom/products/stapler, ../about results in /sites/acmecom/about/, ./neos/info results in /sites/acmecom/products/neos/info. *node starts with a tilde character (~):* The given path is treated as a path relative to the current site node. Example: given that the current node is /sites/acmecom/products/, ~/about/us results in /sites/acmecom/about/us, ~ results in /sites/acmecom.
Show file Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$assetRepository Neos\Media\Domain\Repository\AssetRepository
$lastLinkedNode Neos\ContentRepository\Domain\Model\NodeInterface
$nodeService Neos\Neos\TYPO3CR\NeosNodeServiceInterface
$nodeShortcutResolver Neos\Neos\Domain\Service\NodeShortcutResolver
$propertyMapper Neos\Flow\Property\PropertyMapper
$resourceManager Neos\Flow\ResourceManagement\ResourceManager
$siteRepository Neos\Neos\Domain\Repository\SiteRepository
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Public Methods

Method Description
convertUriToObject ( string | Uri $uri, Neos\ContentRepository\Domain\Model\NodeInterface $contextNode = null ) : Neos\ContentRepository\Domain\Model\NodeInterface | Neos\Media\Domain\Model\AssetInterface | null Return the object the URI addresses or NULL.
createNodeUri ( ControllerContext $controllerContext, mixed $node = null, Neos\ContentRepository\Domain\Model\NodeInterface $baseNode = null, string $format = null, boolean $absolute = false, array $arguments = [], string $section = '', boolean $addQueryString = false, array $argumentsToBeExcludedFromQueryString = [], boolean $resolveShortcuts = true ) : string Renders the URI to a given node instance or -path.
createSiteUri ( ControllerContext $controllerContext, Site $site ) : string
getLastLinkedNode ( ) : Neos\ContentRepository\Domain\Model\NodeInterface Returns the node that was last used to resolve a link to.
getScheme ( string | Uri $uri ) : string
hasSupportedScheme ( string | Uri $uri ) : boolean
resolveAssetUri ( string | Uri $uri ) : string Resolves a given asset:// URI to a "normal" HTTP(S) URI for the addressed asset's resource.
resolveNodeUri ( string | Uri $uri, Neos\ContentRepository\Domain\Model\NodeInterface $contextNode, ControllerContext $controllerContext, boolean $absolute = false ) : string Resolves a given node:// URI to a "normal" HTTP(S) URI for the addressed node.

Method Details

convertUriToObject() public method

Return the object the URI addresses or NULL.
public convertUriToObject ( string | Uri $uri, Neos\ContentRepository\Domain\Model\NodeInterface $contextNode = null ) : Neos\ContentRepository\Domain\Model\NodeInterface | Neos\Media\Domain\Model\AssetInterface | null
$uri string | Neos\Flow\Http\Uri
$contextNode Neos\ContentRepository\Domain\Model\NodeInterface
return Neos\ContentRepository\Domain\Model\NodeInterface | Neos\Media\Domain\Model\AssetInterface | null

createNodeUri() public method

Renders the URI to a given node instance or -path.
public createNodeUri ( ControllerContext $controllerContext, mixed $node = null, Neos\ContentRepository\Domain\Model\NodeInterface $baseNode = null, string $format = null, boolean $absolute = false, array $arguments = [], string $section = '', boolean $addQueryString = false, array $argumentsToBeExcludedFromQueryString = [], boolean $resolveShortcuts = true ) : string
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext
$node mixed A node object or a string node path, if a relative path is provided the baseNode argument is required
$baseNode Neos\ContentRepository\Domain\Model\NodeInterface
$format string Format to use for the URL, for example "html" or "json"
$absolute boolean If set, an absolute URI is rendered
$arguments array Additional arguments to be passed to the UriBuilder (for example pagination parameters)
$section string
$addQueryString boolean If set, the current query parameters will be kept in the URI
$argumentsToBeExcludedFromQueryString array arguments to be removed from the URI. Only active if $addQueryString = TRUE
$resolveShortcuts boolean INTERNAL Parameter - if FALSE, shortcuts are not redirected to their target. Only needed on rare backend occasions when we want to link to the shortcut itself.
return string The rendered URI

createSiteUri() public method

public createSiteUri ( ControllerContext $controllerContext, Site $site ) : string
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext
$site Neos\Neos\Domain\Model\Site
return string

getLastLinkedNode() public method

May return NULL in case no link has been generated or an error occurred on the last linking run.
public getLastLinkedNode ( ) : Neos\ContentRepository\Domain\Model\NodeInterface
return Neos\ContentRepository\Domain\Model\NodeInterface

getScheme() public method

public getScheme ( string | Uri $uri ) : string
$uri string | Neos\Flow\Http\Uri
return string

hasSupportedScheme() public method

public hasSupportedScheme ( string | Uri $uri ) : boolean
$uri string | Neos\Flow\Http\Uri
return boolean

resolveAssetUri() public method

Resolves a given asset:// URI to a "normal" HTTP(S) URI for the addressed asset's resource.
public resolveAssetUri ( string | Uri $uri ) : string
$uri string | Neos\Flow\Http\Uri
return string

resolveNodeUri() public method

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
return string

Property Details

$assetRepository protected property

protected AssetRepository,Neos\Media\Domain\Repository $assetRepository
return Neos\Media\Domain\Repository\AssetRepository

$lastLinkedNode protected property

protected NodeInterface,Neos\ContentRepository\Domain\Model $lastLinkedNode
return Neos\ContentRepository\Domain\Model\NodeInterface

$nodeService protected property

protected NeosNodeServiceInterface,Neos\Neos\TYPO3CR $nodeService
return Neos\Neos\TYPO3CR\NeosNodeServiceInterface

$nodeShortcutResolver protected property

protected NodeShortcutResolver,Neos\Neos\Domain\Service $nodeShortcutResolver
return Neos\Neos\Domain\Service\NodeShortcutResolver

$propertyMapper protected property

protected PropertyMapper,Neos\Flow\Property $propertyMapper
return Neos\Flow\Property\PropertyMapper

$resourceManager protected property

protected ResourceManager,Neos\Flow\ResourceManagement $resourceManager
return Neos\Flow\ResourceManagement\ResourceManager

$siteRepository protected property

protected SiteRepository,Neos\Neos\Domain\Repository $siteRepository
return Neos\Neos\Domain\Repository\SiteRepository

$systemLogger protected property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
return Neos\Flow\Log\SystemLoggerInterface