Skip to content

Commit 237625d

Browse files
committed
Merge branch 'develop' into PHPOffice#160-element-container
2 parents 06ba9e7 + 51a8628 commit 237625d

File tree

6 files changed

+223
-99
lines changed

6 files changed

+223
-99
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This is the changelog between releases of PHPWord. Releases are listed in revers
1414
- Table: Add `exactHeight` to row style to define whether row height should be exact or atLeast - @jcarignan GH-168
1515
- Element: New `CheckBox` element for sections and table cells - @ozilion GH-156
1616
- Settings: Ability to use PCLZip as alternative to ZipArchive - @bskrtich @ivanlanin GH-106 GH-140 GH-185
17+
- Template: Ability to find & replace variables in headers & footers - @dgudgeon GH-190
1718
- Table: Ability to add footnote in table cell - @ivanlanin GH-187
1819
- Footnote: Ability to add image in footnote - @ivanlanin GH-187
1920
- ListItem: Ability to add list item in header/footer - @ivanlanin GH-187

samples/Sample_07_TemplateCloneRow.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
$document = $phpWord->loadTemplate('resources/Sample_07_TemplateCloneRow.docx');
99

10+
// Variables on different parts of document
11+
$document->setValue('weekday', date('l')); // On section/content
12+
$document->setValue('time', date('H:i')); // On footer
13+
$document->setValue('serverName', $_SERVER['SERVER_NAME']); // On header
14+
1015
// Simple table
1116
$document->cloneRow('rowValue', 10);
1217

@@ -32,9 +37,6 @@
3237
$document->setValue('rowNumber#9', '9');
3338
$document->setValue('rowNumber#10', '10');
3439

35-
$document->setValue('weekday', date('l'));
36-
$document->setValue('time', date('H:i'));
37-
3840
// Table with a spanned cell
3941
$document->cloneRow('userId', 3);
4042

4.78 KB
Binary file not shown.

0 commit comments

Comments
 (0)