LinkService implements SingletonInterface

Class LinkService, responsible to find what kind of resource (type) is used to link to (email, external url, file, page etc) with the possibility to get a system-wide understandable "urn" to identify what type it actually is, based on the scheme or prefix.

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Constants

TYPE_EMAIL  = 'email'
TYPE_FILE  = 'file'
TYPE_FOLDER  = 'folder'
TYPE_INPAGE  = 'inpage'
TYPE_PAGE  = 'page'
TYPE_RECORD  = 'record'
TYPE_TELEPHONE  = 'telephone'
TYPE_UNKNOWN  = 'unknown'
TYPE_URL  = 'url'

Properties

$handlers  : array<string|int, LinkHandlingInterface>
All registered LinkHandlers

Methods

__construct()  : mixed
LinkService constructor initializes the registered handlers.
asString()  : string
Returns a string interpretation of the link target, something like
resolve()  : array<string|int, mixed>
Part of the typolink construction functionality, called by typoLink() Used to resolve "legacy"-based typolinks and URNs.
resolveByStringRepresentation()  : array<string|int, mixed>
Returns an array with data interpretation of the link target, something like t3://page?uid=23.

Constants

TYPE_EMAIL

public mixed TYPE_EMAIL = 'email'

TYPE_FOLDER

public mixed TYPE_FOLDER = 'folder'

TYPE_INPAGE

public mixed TYPE_INPAGE = 'inpage'

TYPE_RECORD

public mixed TYPE_RECORD = 'record'

TYPE_TELEPHONE

public mixed TYPE_TELEPHONE = 'telephone'

TYPE_UNKNOWN

public mixed TYPE_UNKNOWN = 'unknown'

Properties

Methods

__construct()

LinkService constructor initializes the registered handlers.

public __construct() : mixed

asString()

Returns a string interpretation of the link target, something like

public asString(array<string|int, mixed> $parameters) : string
  • t3://page?uid=23&my=value#cool
  • https://www.typo3.org/
  • t3://file?uid=13
  • t3://folder?storage=2&identifier=/my/folder/
  • mailto:mac@safe.com
Parameters
$parameters : array<string|int, mixed>
Tags
throws
UnknownLinkHandlerException
Return values
string

resolve()

Part of the typolink construction functionality, called by typoLink() Used to resolve "legacy"-based typolinks and URNs.

public resolve(string $linkParameter) : array<string|int, mixed>

Tries to get the type of the link from the link parameter could be

  • "mailto" an email address
  • "url" external URL
  • "file" a local file (checked AFTER getPublicUrl() is called)
  • "page" a page (integer)

Does NOT check if the page exists or the file exists.

Parameters
$linkParameter : string

could be "fileadmin/myfile.jpg", "info@typo3.org", "13" or "http://www.typo3.org"

Tags
throws
UnknownLinkHandlerException
Return values
array<string|int, mixed>

resolveByStringRepresentation()

Returns an array with data interpretation of the link target, something like t3://page?uid=23.

public resolveByStringRepresentation(string $urn) : array<string|int, mixed>
Parameters
$urn : string
Tags
throws
UnknownLinkHandlerException
throws
UnknownUrnException
Return values
array<string|int, mixed>

        
On this page

Search results