Forum


Replies: 1   Views: 3990
Variable $date$ problem
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  · 23-06-2014 - 14:55

Hello, We have done some tests with this code: ----------------------------- require_once '../classes/CreateDocx.inc'; $docx = new CreateDocxFromTemplate('TemplateSimpleText.docx'); $first = 'PHPDocX'; $multiline = 'This is the first line.\nThis is the second line of text.'; $variables = array('date' => '01.01.2014'); $options = array('parseLineBreaks' =>true); $docx->replaceVariableByText($variables, $options); $docx->createDocx('example_replaceVariableByText_1'); ----------------------------- And the document is generated without issues. So there must be an error in your template or code; we recommend you to check both. Regards.