DiffUtility

Helper service to create a diff HTML of two strings.

It is currently a facade for lolli42/finediff.

Tags
todo

Remove "shared: false" in v14 when $this->stripTags is dropped.

Attributes
#[Autoconfigure]
$shared: false

Table of Contents

Properties

$stripTags  : bool
If set, the HTML tags are stripped from the input strings first.

Methods

diff()  : string
makeDiffDisplay()  : string
Returns a color-marked-up diff output in HTML from the input strings.

Properties

$stripTags

If set, the HTML tags are stripped from the input strings first.

Deprecated

will be removed in TYPO3 v14. Remove together with makeDiffDisplay().

public bool $stripTags = true

Methods

diff()

public diff(string $from, string $to[, DiffGranularity $granularity = DiffGranularity::WORD ]) : string
Parameters
$from : string
$to : string
$granularity : DiffGranularity = DiffGranularity::WORD
Return values
string

makeDiffDisplay()

Returns a color-marked-up diff output in HTML from the input strings.

public makeDiffDisplay(string $str1, string $str2[, DiffGranularity $granularity = DiffGranularity::WORD ]) : string
Deprecated

will be removed in TYPO3 v14. Remove together with $stripTags property.

Parameters
$str1 : string
$str2 : string
$granularity : DiffGranularity = DiffGranularity::WORD
Return values
string

        
On this page

Search results