SoftReferenceParserInterface

Soft Reference parsing interface

"Soft References" are references to database elements, files, email addresses, URLs etc. which are found in-text in content. The <a href="t3://page?[page_id]> tag from typical bodytext fields is an example of this. This interface defines the "parse" method, which parsers have to implement. TYPO3 has already implemented parsers for the most well-known types. Soft Reference Parsers can also be user-defined. The Soft Reference Parsers are used by the system to find these references and process them accordingly in import/export actions and copy operations.

Table of Contents

Methods

getParserKey()  : string
Returns the parser key, which was previously set by "setParserKey"
parse()  : SoftReferenceParserResult
Main function through which can parse content for a specific field.
setParserKey()  : void
The two properties parserKey and parameters may be set to generate a unique token ID from them.

Methods

getParserKey()

Returns the parser key, which was previously set by "setParserKey"

public getParserKey() : string
Return values
string

parse()

Main function through which can parse content for a specific field.

public parse(string $table, string $field, int $uid, string $content[, string $structurePath = '' ]) : SoftReferenceParserResult
Parameters
$table : string

Database table name

$field : string

Field name for which processing occurs

$uid : int

UID of the record

$content : string

The content/value of the field

$structurePath : string = ''

If running from inside a FlexForm structure, this is the path of the tag.

Tags
see
SoftReferenceParserResult
Return values
SoftReferenceParserResult —

Result object on positive matches, see description above.

setParserKey()

The two properties parserKey and parameters may be set to generate a unique token ID from them.

public setParserKey(string $parserKey, array<string|int, mixed> $parameters) : void

This is not needed for every parser, but useful if a parser can deal with multiple parser keys.

Parameters
$parserKey : string

The softref parser key.

$parameters : array<string|int, mixed>

Parameters of the softlink parser. Basically this is the content inside optional []-brackets after the softref keys. Parameters are exploded by ";

On this page

Search results