class HtmlArrayRenderer extends AbstractRenderer (View source)

Array renderer for HTML based diffs

Properties

object $diff from  AbstractRenderer
protected array $defaultOptions
protected array $options from  AbstractRenderer

Methods

__construct(array $options = [])

The constructor. Instantiates the rendering engine and if options are passed, sets the options for the renderer.

setOptions(array $options)

Set the options of the renderer to those supplied in the passed in array.

string
render()

Render and return an array structure suitable for generating HTML based differences. Generally called by subclasses that generate a HTML based diff and return an array of the changes to show in the diff.

string
fixSpaces(string $spaces = '')

Replace a string containing spaces with a HTML representation using  .

Details

__construct(array $options = [])

The constructor. Instantiates the rendering engine and if options are passed, sets the options for the renderer.

Parameters

array $options

Optionally, an array of the options for the renderer.

setOptions(array $options)

Set the options of the renderer to those supplied in the passed in array.

Options are merged with the default to ensure that there aren't any missing options.

Parameters

array $options

Array of options to set.

string render()

Render and return an array structure suitable for generating HTML based differences. Generally called by subclasses that generate a HTML based diff and return an array of the changes to show in the diff.

Return Value

string

The diff

string fixSpaces(string $spaces = '')

Replace a string containing spaces with a HTML representation using  .

Parameters

string $spaces

The string of spaces.

Return Value

string

The HTML representation of the string.