TypoLinkCodecService

This class provides basic functionality to encode and decode typolink strings

Table of Contents

Properties

$emptyValueSymbol  : string
Symbol for TypoLink parts not specified
$partDelimiter  : string
Delimiter for TypoLink string parts

Methods

decode()  : array{url: string, target: string, class: string, title: string, additionalParams: string}
Decodes a TypoLink string into its parts
encode()  : string
Encode TypoLink parts to a single string

Properties

$emptyValueSymbol

Symbol for TypoLink parts not specified

protected static string $emptyValueSymbol = '-'

$partDelimiter

Delimiter for TypoLink string parts

protected static string $partDelimiter = ' '

Methods

decode()

Decodes a TypoLink string into its parts

public decode(string|null $typoLink) : array{url: string, target: string, class: string, title: string, additionalParams: string}
Parameters
$typoLink : string|null

The properly encoded TypoLink string

Tags
todo

Remove the |null and make the signature strict typed in v13 as string

Return values
array{url: string, target: string, class: string, title: string, additionalParams: string}

encode()

Encode TypoLink parts to a single string

public encode(array{url?: string, target?: string, class?: string, title?: string, additionalParams?: string} $typoLinkParts) : string
Parameters
$typoLinkParts : array{url?: string, target?: string, class?: string, title?: string, additionalParams?: string}
Return values
string

Returns a correctly encoded TypoLink string


        
On this page

Search results