DiffUtility
Helper service to create a diff HTML of two strings.
It is currently a facade for lolli42/finediff.
Tags
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.
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
stringmakeDiffDisplay()
Returns a color-marked-up diff output in HTML from the input strings.
public
makeDiffDisplay(string $str1, string $str2[, DiffGranularity $granularity = DiffGranularity::WORD ]) : string
will be removed in TYPO3 v14. Remove together with $stripTags property.
Parameters
- $str1 : string
- $str2 : string
- $granularity : DiffGranularity = DiffGranularity::WORD