‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder:
TYPO3\CMS\Frontend\Tests\Unit\Typolink\Fixtures\AbstractTypolinkBuilderFixture TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder TYPO3\CMS\Frontend\Typolink\ExternalUrlLinkBuilder TYPO3\CMS\Frontend\Typolink\FileOrFolderLinkBuilder TYPO3\CMS\Frontend\Typolink\LegacyLinkBuilder TYPO3\CMS\Frontend\Typolink\PageLinkBuilder TYPO3\CMS\Frontend\Typolink\TelephoneLinkBuilder

Public Member Functions

 __construct (ContentObjectRenderer $contentObjectRenderer, TypoScriptFrontendController $typoScriptFrontendController=null)
 
 build (array &$linkDetails, string $linkText, string $target, array $conf)
 

Protected Member Functions

string forceAbsoluteUrl (string $url, array $configuration)
 
 isLibParseFuncDefined ()
 
string parseFallbackLinkTextIfLinkTextIsEmpty (string $originalLinkText, string $fallbackLinkText)
 
string encodeFallbackLinkTextIfLinkTextIsEmpty (string $originalLinkText, string $fallbackLinkText)
 
string resolveTargetAttribute (array $conf, string $name)
 
 getTypoScriptFrontendController ()
 

Protected Attributes

ContentObjectRenderer $contentObjectRenderer
 
TypoScriptFrontendController $typoScriptFrontendController = null
 

Detailed Description

Abstract class to provide proper helper for most types necessary Hands in the ContentObject and TSFE which are needed here for all the stdWrap magic.

Definition at line 33 of file AbstractTypolinkBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder::__construct ( ContentObjectRenderer  $contentObjectRenderer,
TypoScriptFrontendController  $typoScriptFrontendController = null 
)

Member Function Documentation

◆ build()

TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder::build ( array &  $linkDetails,
string  $linkText,
string  $target,
array  $conf 
)
abstract

Should be implemented by all subclasses to return an array with three parts:

  • ‪URL
  • ‪Link Text (can be modified)
  • ‪Target (can be modified)
  • ‪Tag Attributes (optional)
Parameters
array$linkDetails‪parsed link details by the LinkService
string$linkText‪the link text
string$target‪the target to point to
array$conf‪the TypoLink configuration array
Exceptions
UnableToLinkException

Reimplemented in TYPO3\CMS\Frontend\Typolink\PageLinkBuilder, TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder, TYPO3\CMS\Frontend\Typolink\FileOrFolderLinkBuilder, TYPO3\CMS\Frontend\Typolink\LegacyLinkBuilder, TYPO3\CMS\Frontend\Typolink\ExternalUrlLinkBuilder, TYPO3\CMS\Frontend\Tests\Unit\Typolink\Fixtures\AbstractTypolinkBuilderFixture, and TYPO3\CMS\Frontend\Typolink\TelephoneLinkBuilder.

◆ encodeFallbackLinkTextIfLinkTextIsEmpty()

string TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder::encodeFallbackLinkTextIfLinkTextIsEmpty ( string  $originalLinkText,
string  $fallbackLinkText 
)
protected

Helper method to a fallback method properly encoding HTML.

Parameters
string$originalLinkText‪the original string, if empty, the fallback link text
string$fallbackLinkText‪the string to be used.
Returns
‪string the final text

Definition at line 158 of file AbstractTypolinkBuilder.php.

Referenced by TYPO3\CMS\Frontend\Typolink\ExternalUrlLinkBuilder\build(), TYPO3\CMS\Frontend\Typolink\LegacyLinkBuilder\build(), TYPO3\CMS\Frontend\Typolink\FileOrFolderLinkBuilder\build(), and TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder\parseFallbackLinkTextIfLinkTextIsEmpty().

◆ forceAbsoluteUrl()

string TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder::forceAbsoluteUrl ( string  $url,
array  $configuration 
)
protected

◆ getTypoScriptFrontendController()

TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder::getTypoScriptFrontendController ( )
protected

◆ isLibParseFuncDefined()

TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder::isLibParseFuncDefined ( )
protected

Determines whether lib.parseFunc is defined.

Definition at line 123 of file AbstractTypolinkBuilder.php.

Referenced by TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder\parseFallbackLinkTextIfLinkTextIsEmpty().

◆ parseFallbackLinkTextIfLinkTextIsEmpty()

string TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder::parseFallbackLinkTextIfLinkTextIsEmpty ( string  $originalLinkText,
string  $fallbackLinkText 
)
protected

Helper method to a fallback method parsing HTML out of it

Parameters
string$originalLinkText‪the original string, if empty, the fallback link text
string$fallbackLinkText‪the string to be used.
Returns
‪string the final text

Definition at line 139 of file AbstractTypolinkBuilder.php.

References TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder\encodeFallbackLinkTextIfLinkTextIsEmpty(), and TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder\isLibParseFuncDefined().

Referenced by TYPO3\CMS\Frontend\Typolink\PageLinkBuilder\build().

◆ resolveTargetAttribute()

string TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder::resolveTargetAttribute ( array  $conf,
string  $name 
)
protected

Creates the value for target="..." in a typolink configuration

Parameters
array$conf‪the typolink configuration
string$name‪the key, usually "target", "extTarget" or "fileTarget"
Returns
‪string the value of the target attribute, if there is one

Reimplemented in TYPO3\CMS\Frontend\Tests\Unit\Typolink\Fixtures\AbstractTypolinkBuilderFixture.

Definition at line 173 of file AbstractTypolinkBuilder.php.

Referenced by TYPO3\CMS\Frontend\Typolink\ExternalUrlLinkBuilder\build(), TYPO3\CMS\Frontend\Typolink\FileOrFolderLinkBuilder\build(), TYPO3\CMS\Frontend\Typolink\LegacyLinkBuilder\build(), and TYPO3\CMS\Frontend\Typolink\PageLinkBuilder\calculateTargetAttribute().

Member Data Documentation

◆ $contentObjectRenderer

ContentObjectRenderer TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder::$contentObjectRenderer
protected

◆ $typoScriptFrontendController

TypoScriptFrontendController TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder::$typoScriptFrontendController = null
protected