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.
Deleted by IanTechnoReadapt ·
13-06-2014 - 19:57In your example, you are missing a closing parenthesis on the line $docx->replaceVariableByText(array('NAME' => 'John Smith');
should be
$docx->replaceVariableByText(array('NAME' => 'John Smith'));
Otherwise, does replaceVariableByText works in headers? I'm trying to generate a word file that have a variable company name in the headers of some pages. placing $COMPANY_NAME$ in the headers of my template doesn't do the trick.
Hello,
Thanks, we're going to fix the mistake.
About the method, I recommend you to read the API documentation:
http://www.phpdocx.com/api-documentation/templates/replace-variable-text-Word-document
As you can see, the target option allows you to set where the replace the placeholders.
Regards.