A user of PHPDocX reported us an issue in our library when attempting to create a template with more than one HTML variable replacement. Here is the patch which must be applied to solve this problem.
[code]
--- /classes/CreateTemplate.inc
+++ /classes/CreateTemplate.inc
@@ -773,7 +773,7 @@
// add source string and dest filepath
self::$embedFiles[] = array(
'src_string' => '<html>' . $args[1] . '</html>',
- 'dest_file' => 'html' . $this->_idDOCX . '.htm'
+ 'dest_file' => 'html' . $this->_idHTML . '.htm'
);
$args[1] = '<' . CreateElement::NAMESPACEWORD . ':altChunk r:id="rHTMLId' . $this->_idHTML . '" ' .
'xmlns:r="http://schemas.openxmlformats.org/' . 'officeDocument/2006/relationships" ' .
@@ -794,7 +794,7 @@
// add source and dest filepath
self::$embedFiles[] = array(
'src_file' => $args[1],
- 'dest_file' => 'rtf' . $this->_idDOCX . '.rtf'
+ 'dest_file' => 'rtf' . $this->_idRTF . '.rtf'
);
$args[1] = '<' . CreateElement::NAMESPACEWORD .
':altChunk r:id="rRTFId' . $this->_idRTF . '" ' .
[/code]
Regards