HtmlWorker

class \TYPO3\CMS\Frontend\Html\HtmlWorker

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Constants

REMOVE_ATTR_ON_FAILURE  : mixed = 2
Removes corresponding attribute in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> `<a>value</a>`
REMOVE_ENCLOSURE_ON_FAILURE  : mixed = 4
Removes corresponding enclosure in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> `value`
REMOVE_TAG_ON_FAILURE  : mixed = 1
Removes corresponding tag in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> ``

Properties

$document  : DOMDocument|null
$linkFactory  : LinkFactory
$mount  : DOMNode|null
$parser  : HTML5

Methods

__construct()  : mixed
__toString()  : string
addNonceAttribute()  : self
parse()  : self
transformUri()  : self
mountFragment()  : DOMNode
onTransformUriFailure()  : void
parseSelector()  : array{node: string, attr: string}[]

Constants

REMOVE_ATTR_ON_FAILURE

Removes corresponding attribute in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> `<a>value</a>`

public mixed REMOVE_ATTR_ON_FAILURE = 2

REMOVE_ENCLOSURE_ON_FAILURE

Removes corresponding enclosure in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> `value`

public mixed REMOVE_ENCLOSURE_ON_FAILURE = 4

REMOVE_TAG_ON_FAILURE

Removes corresponding tag in case there's a failure e.g. `<a href="t3://!!INVALID!!">value</a>` --> ``

public mixed REMOVE_TAG_ON_FAILURE = 1

Properties

$document

protected DOMDocument|null $document = null

$mount

protected DOMNode|null $mount = null

Methods

__toString()

public __toString() : string

Return values

string

addNonceAttribute()

public addNonceAttribute(string|ConsumableNonce $nonce, string ...$nodeNames) : self

Parameters

$nonce : string|ConsumableNonce

none value to be added

$nodeNames : string

element node names to be processed (e.g. style)

Return values

self

parse()

public parse(string $html) : self

Parameters

$html : string

Return values

self

transformUri()

public transformUri(string $selector[, int $flags = 0 ]) : self

Parameters

$selector : string
$flags : int = 0

Return values

self

mountFragment()

protected mountFragment(DOMDocumentFragment $fragment) : DOMNode

Parameters

$fragment : DOMDocumentFragment

Return values

DOMNode

onTransformUriFailure()

protected onTransformUriFailure(DOMElement $element, array{node: string, attr: string} $subject, int $flags) : void

Parameters

$element : DOMElement

current element encountered failure

$subject : array{node: string, attr: string}

node-attr combination

$flags : int

parseSelector()

protected parseSelector(string $selector) : array{node: string, attr: string}[]

Parameters

$selector : string

Return values

array{node: string, attr: string}[]
On this page