From 5517eefce1c3bfe25e875e2e43129e4a49aedfdd Mon Sep 17 00:00:00 2001 From: flack Date: Sat, 29 Oct 2016 20:05:04 +0200 Subject: [PATCH] Make table headings configurable --- lib/Diff/Renderer/Html/SideBySide.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/Diff/Renderer/Html/SideBySide.php b/lib/Diff/Renderer/Html/SideBySide.php index eb438483..02a0337e 100644 --- a/lib/Diff/Renderer/Html/SideBySide.php +++ b/lib/Diff/Renderer/Html/SideBySide.php @@ -44,6 +44,16 @@ class Diff_Renderer_Html_SideBySide extends Diff_Renderer_Html_Array { + /** + * Default options: newValue and oldValue set the labels for table heading + * + * @var array + */ + protected $defaultOptions = array( + 'oldVersion' => 'Old Version', + 'newVersion' => 'New Version' + ); + /** * Render a and return diff with changes between the two sequences * displayed side by side. @@ -62,8 +72,8 @@ public function render() $html .= ''; $html .= ''; $html .= ''; - $html .= ''; - $html .= ''; + $html .= ''; + $html .= ''; $html .= ''; $html .= ''; foreach($changes as $i => $blocks) { @@ -160,4 +170,4 @@ public function render() $html .= '
Old VersionNew Version' . $this->options['oldVersion'] . '' . $this->options['newVersion'] . '
'; return $html; } -} \ No newline at end of file +}