DatabaseRecordLinkBuilder
readonly class \
- Implements
- TypolinkBuilderInterface
Builds a TypoLink to a database record
Table of Contents
Interfaces
- TypolinkBuilderInterface
- Used to generate a link to a page or file, an external URL or any other protocol in the frontend or backend.
Methods
- __construct() : mixed
- buildLink() : LinkResultInterface
- getPageTsConfig() : array
- Helper method to calculate pageTsConfig in frontend scope, we can't use BackendUtility::getPagesTSconfig() here.
- getTargetLanguageAspect() : LanguageAspect|null
- Returns the language aspect of the target language, if the link selects one by "_language" or "L" (in this order of precedence, as done by PageLinkBuilder).
Methods
__construct()
public
__construct(TcaSchemaFactory $schemaFactory, FrontendInterface $runtimeCache, TypoLinkCodecService $typoLinkCodecService, EventDispatcherInterface $eventDispatcher) : mixed
Parameters
- $schemaFactory : TcaSchemaFactory
- $runtimeCache : FrontendInterface
- $typoLinkCodecService : TypoLinkCodecService
- $eventDispatcher : EventDispatcherInterface
buildLink()
public
buildLink(array $linkDetails, array $configuration, ServerRequestInterface $request[, string $linkText = '' ]) : LinkResultInterface
Parameters
- $linkDetails : array
-
parsed link details by the LinkService
- $configuration : array
-
the TypoLink configuration array
- $request : ServerRequestInterface
- $linkText : string = ''
-
the link text
Return values
LinkResultInterfacegetPageTsConfig()
Helper method to calculate pageTsConfig in frontend scope, we can't use BackendUtility::getPagesTSconfig() here.
protected
getPageTsConfig(ServerRequestInterface $request) : array
Parameters
- $request : ServerRequestInterface
Return values
arraygetTargetLanguageAspect()
Returns the language aspect of the target language, if the link selects one by "_language" or "L" (in this order of precedence, as done by PageLinkBuilder).
protected
getTargetLanguageAspect(array $queryParameters, array $typoScriptConfiguration, array $configuration, ServerRequestInterface $request) : LanguageAspect|null
Returns null, if the current language applies.
Parameters
- $queryParameters : array
- $typoScriptConfiguration : array
- $configuration : array
- $request : ServerRequestInterface