File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change
1
+ # [ 2.0.4] ( https://github.com/phalcongelist/php-diff/releases/tag/v2.0.4 ) (2016-XX-XX)
2
+
3
+ * Added ability to set title for ` SideBySide ` renderer
4
+
1
5
# [ 2.0.3] ( https://github.com/phalcongelist/php-diff/releases/tag/v2.0.3 ) (2016-07-18)
2
6
3
7
* Fixed ` BaseArray ` class name
Original file line number Diff line number Diff line change 25
25
*/
26
26
class SideBySide extends BaseArray
27
27
{
28
+ private $ oldTitle = 'Old Version ' ;
29
+ private $ newTitle = 'New Version ' ;
30
+
28
31
/**
29
32
* Render a and return diff with changes between the two sequences
30
33
* displayed side by side.
@@ -40,11 +43,19 @@ public function render()
40
43
return $ html ;
41
44
}
42
45
46
+ if (isset ($ this ->options ['oldTitle ' ])) {
47
+ $ this ->oldTitle = $ this ->options ['oldTitle ' ];
48
+ }
49
+
50
+ if (isset ($ this ->options ['newTitle ' ])) {
51
+ $ this ->newTitle = $ this ->options ['newTitle ' ];
52
+ }
53
+
43
54
$ html .= '<table class="Differences DifferencesSideBySide"> ' ;
44
55
$ html .= '<thead> ' ;
45
56
$ html .= '<tr> ' ;
46
- $ html .= '<th colspan="2">Old Version </th> ' ;
47
- $ html .= '<th colspan="2">New Version </th> ' ;
57
+ $ html .= '<th colspan="2"> ' . $ this -> oldTitle . ' </th> ' ;
58
+ $ html .= '<th colspan="2"> ' . $ this -> newTitle . ' </th> ' ;
48
59
$ html .= '</tr> ' ;
49
60
$ html .= '</thead> ' ;
50
61
You can’t perform that action at this time.
0 commit comments