LegacyLinkBuilder extends AbstractTypolinkBuilder implements TypolinkBuilderInterface
Builds a TypoLink to a file (relative to fileadmin/ or something) or otherwise detects as an external URL
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
- buildLink() : LinkResultInterface
- encodeFallbackLinkTextIfLinkTextIsEmpty() : string
- Helper method to a fallback method properly encoding HTML.
- forceAbsoluteUrl() : string
- Forces a given URL to be absolute.
- resolveTargetAttribute() : string
- Creates the value for target="..." in a typolink configuration
Methods
buildLink()
public
buildLink(array<string|int, mixed> $linkDetails, array<string|int, mixed> $configuration, ServerRequestInterface $request[, string $linkText = '' ]) : LinkResultInterface
Parameters
- $linkDetails : array<string|int, mixed>
-
parsed link details by the LinkService
- $configuration : array<string|int, mixed>
-
the TypoLink configuration array
- $request : ServerRequestInterface
- $linkText : string = ''
-
the link text
Return values
LinkResultInterfaceencodeFallbackLinkTextIfLinkTextIsEmpty()
Helper method to a fallback method properly encoding HTML.
protected
encodeFallbackLinkTextIfLinkTextIsEmpty(string $originalLinkText, string $fallbackLinkText) : string
Parameters
- $originalLinkText : string
-
the original string, if empty, the fallback link text
- $fallbackLinkText : string
-
the string to be used.
Return values
string —the final text
forceAbsoluteUrl()
Forces a given URL to be absolute.
protected
forceAbsoluteUrl(string $url, array<string|int, mixed> $configuration[, ServerRequestInterface|null $request = null ]) : string
Parameters
- $url : string
-
The URL to be forced to be absolute
- $configuration : array<string|int, mixed>
-
TypoScript configuration of typolink
- $request : ServerRequestInterface|null = null
Return values
string —The absolute URL
resolveTargetAttribute()
Creates the value for target="..." in a typolink configuration
protected
resolveTargetAttribute(array<string|int, mixed> $conf, string $name[, ContentObjectRenderer|null $contentObjectRenderer = null ]) : string
Parameters
- $conf : array<string|int, mixed>
-
the typolink configuration
- $name : string
-
the key, usually "target", "extTarget" or "fileTarget"
- $contentObjectRenderer : ContentObjectRenderer|null = null
Return values
string —the value of the target attribute, if there is one