Forum


Replies: 1   Views: 3781
Html on templates error
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin-phpdocx  · 28-07-2011 - 14:32

Hi everybody,

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