Forum


Replies: 3   Views: 4025
Replacevariablebytext not working in a header section
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 afoeder  · 04-02-2015 - 16:21

For the (our) record, the error occurs when working in header or footer target and using *subsequent* invocations of replaceVariableByText, just like $docx->replaceVariableByText(array('one' => 'ONE REPLACED'), array('target' => 'footer')); $docx->replaceVariableByText(array('another' => 'ANOTHER REPLACED'), array('target' => 'footer')); "Merging" the replacement array and using only one invocation would work.