ExternalUrlLinkBuilder

class \TYPO3\CMS\Frontend\Typolink\ExternalUrlLinkBuilder

Extends
AbstractTypolinkBuilder
Implements
TypolinkBuilderInterface

Builds a TypoLink to 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

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

LinkResultInterface

encodeFallbackLinkTextIfLinkTextIsEmpty()

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 $configuration[, ServerRequestInterface|null $request = null ]) : string

Parameters

$url : string

The URL to be forced to be absolute

$configuration : array

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 $conf, string $name[, ContentObjectRenderer|null $contentObjectRenderer = null ]) : string

Parameters

$conf : array

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

On this page